본문 바로가기

전체 글

[HackerRank][SQL][Aggregation] Weather Observation Station 21 - 컴도리돌이 Weather Observation Station 20 | HackerRank Query the median of Northern Latitudes in STATION and round to 4 decimal places. www.hackerrank.com Problem A median is defined as a number separating the higher half of a data set from the lower half. Query the median of the Northern Latitudes (LAT_N) from STATION and round your answer to 4 decimal places. -> lat_n의 중간 값을 반올림 해서 소수점 4번째 자리까지 출력하시오. SQ.. 더보기
[HackerRank][SQL][Aggregation] Weather Observation Station 19 - 컴도리돌이 Weather Observation Station 19 | HackerRank Query the Euclidean Distance between two points and round to 4 decimal digits. www.hackerrank.com Problem Consider P1(a,b) and P2(c,d) to be two points on a 2D plane where (a,b) are the respective minimum and maximum values of Northern Latitude (LAT_N) and (c,d) are the respective minimum and maximum values of Western Longitude (LONG_W) in STATION. Que.. 더보기
[HackerRank][SQL][Aggregation] Weather Observation Station 18 - 컴도리돌이 Weather Observation Station 18 | HackerRank Query the Manhattan Distance between two points, round or truncate to 4 decimal digits. www.hackerrank.com Problem Consider P1(a,b) and P2(c,d) to be two points on a 2D plane. a happens to equal the minimum value in Northern Latitude (LAT_N in STATION). b happens to equal the minimum value in Western Longitude (LONG_W in STATION). c happens to equal th.. 더보기
[HackerRank][SQL][Aggregation] Weather Observation Station 17 - 컴도리돌이 Weather Observation Station 17 | HackerRank Query the Western Longitude for the smallest value of the Northern Latitudes greater than 38.7780 in STATION and round to 4 decimal places. www.hackerrank.com Problem Query the Western Longitude (LONG_W)where the smallest Northern Latitude (LAT_N) in STATION is greater than 38.7780 . Round your answer to 4 decimal places. -> lat_n 이 38.7780보다 큰 lat_n중에.. 더보기
[파이썬][백준 18430][백트래킹] 무기공학 - 컴도리돌이 18430번: 무기 공학 첫째 줄에는 길동이가 가지고 있는 나무 재료의 세로, 가로 크기를 의미하는 두 자연수 N, M이 주어진다. (1 ≤ N, M ≤ 5) 다음 N개의 줄에 걸쳐서, 매 줄마다 나무 재료의 각 위치의 강도를 나타내 www.acmicpc.net 풀이 과정 (처음 시도) 처음에는 이중 for문으로 방문하지 않은 i, j가 있다면 해당 위치가 중앙으로 두었을 때 문제에서 요구하는 이미지가 형성되고, 방문하지 않은 이미지라면 방문 체크하고 탐색하게끔 설정하였는데, 이렇게 두면 아무리 가로 세로 크기가 5 이하여도 시간 초과가 발생한다. ㅠㅠ 1. 다른 분의 코드를 참고해서 이중 for문을 사용하지 않고 오른쪽 열로 하나씩 좌표 값을 탐색 인자에 넣어줬다. 그리고 행이 n과 같을 경우 강도의 .. 더보기
[파이썬][백준 16198][백트래킹] 에너지 모으기 - 컴도리돌이 16198번: 에너지 모으기 N개의 에너지 구슬이 일렬로 놓여져 있고, 에너지 구슬을 이용해서 에너지를 모으려고 한다. i번째 에너지 구슬의 무게는 Wi이고, 에너지를 모으는 방법은 다음과 같으며, 반복해서 사용할 수 있 www.acmicpc.net 풀이 과정 1. 주어진 n의 개수가 너무나 작기 때문에 모든 경우의 수를 구해주면 된다. 2. i번째를 삭제할 경우의 현재 에너지양 + w[i-1] * w[i+1], i번째를 제외한 w 배열, depth - 1로 탐색을 한다. 3. depth 가 3일 될 경우 경우의 수가 배열의 맨앞의 에너지 값 * 배열의 마지막 에너지 값만 계산 할 수 있기 때문에 해당 값과 현재 에너지를 더해서 반환해준다. 4. 가장 큰 값을 반환해준다. 풀이 코드 import sys;.. 더보기
[HackerRank][SQL] Weather Observation Station 16 - 컴도리돌이 Weather Observation Station 16 | HackerRank Query the smallest of STATION's Northern Latitudes that is greater than 38.7780, and round to 4 decimal places www.hackerrank.com Problem Query the smallest Northern Latitude (LAT_N) from STATION that is greater than 38.7780 . Round your answer to 4 decimal places. -> 38.7780 보다 큰 lat_n 중에서 가장 작은 값을 소수점 4자리에서 반올림하여 출력하시오. Answer select round(min(lat_n).. 더보기
[HackerRank][SQL] Weather Observation Station 15 - 컴도리돌이 Weather Observation Station 15 | HackerRank Query the Western Longitude for the largest Northern Latitude under 137.2345, rounded to 4 decimal places. www.hackerrank.com Problem Query the Western Longitude (LONG_W) for the largest Northern Latitude (LAT_N) in STATION that is less than 137.2345 . Round your answer to 4 decimal places. -> lat_n이 137.2345보다 작은 값중에서 제일 큰 lat_n을 가진 long_w를 소수점 4자리에서 .. 더보기

728x90