공부
-
[programmers] 프린터 / C++공부/PS (programmers) 2022. 5. 18. 00:35
https://programmers.co.kr/learn/courses/30/lessons/42587 코딩테스트 연습 - 프린터 일반적인 프린터는 인쇄 요청이 들어온 순서대로 인쇄합니다. 그렇기 때문에 중요한 문서가 나중에 인쇄될 수 있습니다. 이런 문제를 보완하기 위해 중요도가 높은 문서를 먼저 인쇄하는 프린 programmers.co.kr #include #include #include #include using namespace std; int solution(vector priorities, int location) { int answer = 0, cnt = 1; int sequence[110] = {0, }; // 각 문서가 프린트된 순서를 저장 queue q; priority_queue pq;..
-
[HackerRank/Aggregation] Revising Aggregations - The Count Function공부/PS ( SQL) 2022. 5. 17. 01:19
https://www.hackerrank.com/challenges/revising-aggregations-the-count-function/problem Revising Aggregations - The Count Function | HackerRank Query the number of cities having populations larger than 100000. www.hackerrank.com 문제 풀이 SELECT COUNT(NAME) FROM CITY WHERE POPULATION > 100000
-
[HackerRank/Advanced Select] The PADS공부/PS ( SQL) 2022. 5. 16. 01:29
https://www.hackerrank.com/challenges/the-pads/problem The PADS | HackerRank Query the name and abbreviated occupation for each person in OCCUPATIONS. www.hackerrank.com 문제 풀이 SELECT CONCAT(Name, "(", LEFT(Occupation,1), ")") FROM OCCUPATIONS ORDER BY Name; SELECT CONCAT("There are a total of ", COUNT(occupation), " ", LOWER(Occupation), "s.") FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(..
-
[HackerRank/Advanced Select] Type of Triangle공부/PS ( SQL) 2022. 5. 16. 01:12
https://www.hackerrank.com/challenges/what-type-of-triangle/problem Type of Triangle | HackerRank Query a triangle's type based on its side lengths. www.hackerrank.com 문제 풀이 SELECT CASE WHEN A = B AND B = C THEN 'Equilateral' WHEN A >= B+C OR B >= A+C OR C >= A+B THEN 'Not A Triangle' WHEN A = B OR B = C OR C = A THEN 'Isosceles' ELSE 'Scalene' END FROM TRIANGLES; CASE문 SELECT CASE WHEN 조건 THEN ..
-
[HackerRank/Basic Select] Employee Salaries공부/PS ( SQL) 2022. 5. 16. 00:44
https://www.hackerrank.com/challenges/salary-of-employees/problem Employee Salaries | HackerRank Print the names of employees who earn more than $2000 per month and have worked at the company for less than 10 months. www.hackerrank.com 문제 풀이 SELECT name FROM Employee WHERE salary > 2000 AND months < 10 ORDER BY employee_id
-
[HackerRank/Basic Select] Higher Than 75 Marks공부/PS ( SQL) 2022. 5. 16. 00:39
https://www.hackerrank.com/challenges/more-than-75-marks/problem Higher Than 75 Marks | HackerRank Query the names of students scoring higher than 75 Marks. Sort the output by the LAST three characters of each name. www.hackerrank.com 문제 풀이 SELECT Name FROM STUDENTS WHERE Marks > 75 ORDER BY SUBSTR(Name, -3), ID Name 문자열의 뒤 3글자를 정렬 기준으로 삼아야 함 SUBSTR("문자열", '시작 index', '길이') 또는 SUBSTRING("문자열", '..
-
[HackerRank/Basic Select] Weather Observation Station 12공부/PS ( SQL) 2022. 5. 16. 00:16
https://www.hackerrank.com/challenges/weather-observation-station-12/problem Weather Observation Station 12 | HackerRank Query an alphabetically ordered list of CITY names not starting and ending with vowels. www.hackerrank.com 문제 풀이 SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP "^[^aeiou]" AND CITY REGEXP "[^aeiou]$"