전체 글
-
[HackerRank/Basic Select] Weather Observation Station 7공부/PS ( SQL) 2022. 5. 15. 23:21
https://www.hackerrank.com/challenges/weather-observation-station-7/problem Weather Observation Station 7 | HackerRank Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. www.hackerrank.com 문제 풀이 SELECT DISTINCT CITY FROM STATION WHERE CITY LIKE '%a' OR CITY LIKE '%e' OR CITY LIKE '%i' OR CITY LIKE '%o' OR CITY LIKE '%u'
-
[HackerRank/Basic Select] Weather Observation Station 6공부/PS ( SQL) 2022. 5. 15. 23:18
https://www.hackerrank.com/challenges/weather-observation-station-6/problem Weather Observation Station 6 | HackerRank Query a list of CITY names beginning with vowels (a, e, i, o, u). www.hackerrank.com 문제 풀이 SELECT DISTINCT CITY FROM STATION WHERE CITY LIKE 'a%' OR CITY LIKE 'e%' OR CITY LIKE 'i%' OR CITY LIKE 'o%' OR CITY LIKE 'u%'
-
[HackerRank/Basic Select] Weather Observation Station 5공부/PS ( SQL) 2022. 5. 15. 23:11
https://www.hackerrank.com/challenges/weather-observation-station-5/problem Weather Observation Station 5 | HackerRank Write a query to print the shortest and longest length city name along with the length of the city names. www.hackerrank.com 문제 풀이 SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY), CITY LIMIT 1; SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY) DESC, CITY ..
-
[HackerRank/Basic Select] Weather Observation Station 4공부/PS ( SQL) 2022. 5. 15. 22:48
https://www.hackerrank.com/challenges/weather-observation-station-4/problem?isFullScreen=true Weather Observation Station 4 | HackerRank Find the number of duplicate CITY names in STATION. www.hackerrank.com 문제 풀이 SELECT COUNT(CITY) - COUNT(DISTINCT(CITY)) FROM STATION
-
[C++] STL - map, set공부/C, C++ 2022. 5. 12. 17:33
STL container - 시퀀스 컨테이너 / 연관 컨테이너 시퀀스 컨테이너: vector, list, deque 등 순서대로 데이터를 보관할때 사용 연관 컨테이너: map, set 등 형태로 데이터를 보관할때 사용. 찾고자하는 데이터를 빠르게 찾을 때 사용. map, set key의 중복을 허용하지 않음 중복되는 key를 사용하는 경우에는 컨테이너 앞에 'multi'를 붙임. ex) multi_map, multi_set key 기준으로 데이터를 정렬하여 저장함 map Red-Black tree 자료구조를 가짐 형태로 데이터를 저장 key를 기준으로 오름차순 정렬함 map 선언 예시) #include map map1; set map과 비슷하지만 map과 달리 key만 저장함 key를 기준으로 오름차순 ..
-
[BOJ] 19238 스타트 택시 / C++공부/PS (백준) 2022. 4. 28. 23:49
https://www.acmicpc.net/problem/19238 19238번: 스타트 택시 첫 줄에 N, M, 그리고 초기 연료의 양이 주어진다. (2 ≤ N ≤ 20, 1 ≤ M ≤ N2, 1 ≤ 초기 연료 ≤ 500,000) 연료는 무한히 많이 담을 수 있기 때문에, 초기 연료의 양을 넘어서 충전될 수도 있다. 다 www.acmicpc.net #include #include #include #include #define MAX_N 21 #define MAX_M 401 using namespace std; int N, M, fuel; int MAP[MAX_N][MAX_N]; // -2: EMPTY, -1: int dist[MAX_N][MAX_N]; struct DRIVER { int r, c, t;..
-
[BOJ] 23288 주사위 굴리기 2공부/PS (백준) 2022. 4. 24. 21:07
https://www.acmicpc.net/problem/23288 23288번: 주사위 굴리기 2 크기가 N×M인 지도가 존재한다. 지도의 오른쪽은 동쪽, 위쪽은 북쪽이다. 지도의 좌표는 (r, c)로 나타내며, r는 북쪽으로부터 떨어진 칸의 개수, c는 서쪽으로부터 떨어진 칸의 개수이다. 가장 왼 www.acmicpc.net #include #include #define MAX21 using namespace std; int N, M, K; int BOARD[MAX][MAX]; int visited[MAX][MAX]; int dr[] = { -1,0,1,0 }; // 북동남서 int dc[] = { 0,1,0,-1 }; struct DICE { int r, c, bottom, top, front, b..