분류 전체보기 (111) 썸네일형 리스트형 백준 11974 Subsequences Summing to Sevens (USACO January 2016 Silver 2번) 문제 링크: https://www.acmicpc.net/problem/11974 11974번: Subsequences Summing to Sevens Farmer John's \(N\) cows are standing in a row, as they have a tendency to do from time to time. Each cow is labeled with a distinct integer ID number so FJ can tell them apart. FJ would like to take a photo of a contiguous group of cows but, due to a trau www.acmicpc.net Prefix Sum 문제 예시를 보면, 3 5 1 6 2 14 10이라는 .. 백준 3054 피터팬 프레임 (COCI 2006/2007 Contest #1 3번) 문제 링크: https://www.acmicpc.net/problem/3054 3054번: 피터팬 프레임 문제 "피터팬 프레임"은 단어를 다이아몬드 형태로 장식하는 것이다. 알파벳 X를 피터팬 프레임으로 장식하면 다음과 같다. ..#.. .#.#. #.X.# .#.#. ..#.. "웬디 프레임"은 피터팬 프레임과 유사하지만, 다이아몬드를 '*'로 만드는 것이다. 알파벳 X를 웬디 프레임으로 장식하면 다음과 같다. ..*.. .*.*. *.X.* .*.*. ..*.. 단어가 주어졌을 때, 3의 배수 위치(세 번째, 여섯 번째, 아홉번째, ...)에 있는 알파 www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2.. 백준 2667 단지번호붙이기 (KOI 1996 초등부 1번) 문제 링크: https://www.acmicpc.net/problem/2667 2667번: 단지번호붙이기 과 같이 정사각형 모양의 지도가 있다. 1은 집이 있는 곳을, 0은 집이 없는 곳을 나타낸다. 철수는 이 지도를 가지고 연결된 집들의 모임인 단지를 정의하고, 단지에 번호를 붙이려 한다. 여기서 연결되었다는 것은 어떤 집이 좌우, 혹은 아래위로 다른 집이 있는 경우를 말한다. 대각선상에 집이 있는 경우는 연결된 것이 아니다. 는 을 단지별로 번호를 붙인 것이다. 지도를 입력하여 단지수를 출력하고, 각 단지에 속하는 집의 수 www.acmicpc.net DFS '1'로 이루어져 있는 component의 갯수와, 각 component마다 vertex의 갯수를 구해서 오름차순으로 sort하면 됨. 1 2 .. 백준 3029 경고 (COCI 2006/2007 Contest #5 2번) 문제 링크: https://www.acmicpc.net/problem/3029 3029번: 경고 문제 창영마을에서 정인이의 반란은 실패로 끝났다. (3028번) 테러리스트로 변신한 정인이는 창영마을에 경고를 하려고 한다. 사실 정인이는 창영마을에서 제일 착한사람이다. 따라서, 사람들을 다치지 않게하려고 한다. 유튜브에서 폭발에 대한 동영상을 찾아보다가, 그는 나트륨을 물에 던지면 폭발한다는 사실을 알게 되었다. 정인이는 창영마을의 중심을 지나는 "강산강" 근처에 숨어있다가, 나트륨을 위의 동영상처럼 물에 던질 것이다. 현재 시간과 정인이가 나트륨을 www.acmicpc.net 시작시간과 끝시간 둘다 초로 바꾼다음, (끝시간 + 24 * 3600 - 시작시간) % (24 * 3600) 으로 기다리는 시간을.. 백준 15751 Teleportation (USACO February 2018 Bronze 1번) 문제 링크: https://www.acmicpc.net/problem/15751 15751번: Teleportation The first and only line of input contains four space-separated integers: $a$ and $b$, describing the start and end locations, followed by $x$ and $y$, describing the teleporter. All positions are integers in the range $0 \ldots 100$, and they are not neces www.acmicpc.net 세가지 방법중 최소값이 답임. 1. 시작점에서 도착점으로 순간이동 없이 바로 가는것. 2. 시작점에서 x.. 백준 15594 Out of Place (USACO January 2018 Bronze 3번) 문제 링크: https://www.acmicpc.net/problem/15594 15594번: Out of Place The first line of input contains $N$ ($2 \leq N \leq 100$). The next $N$ lines describe the heights of the cows as they are lined up after Bessie makes her move. Each cow height is an integer in the range $1 \ldots 1,000,000$. Cows may have the same height www.acmicpc.net 먼저 숫자들을 bef, aft 두 배열에 입력받은후, aft 배열만 sort함으로써, bef 배열을 aft.. 백준 15593 Lifeguards (USACO January 2018 Bronze 2번) 문제 링크: https://www.acmicpc.net/problem/15593 15593번: Lifeguards (Bronze) The first line of input contains $N$ ($1 \leq N \leq 100$). Each of the next $N$ lines describes a lifeguard in terms of two integers in the range $0 \ldots 1000$, giving the starting and ending point of a lifeguard's shift. All such endpoints are distinct www.acmicpc.net 한명씩 차례대로 뺀 상태에서 커버되는 시간을 구하고, 그 값들의 최대값을 구하면 됨. 1 2 .. 백준 11973 Angry Cows (USACO January 2016 Silver 1번) 문제 링크: https://www.acmicpc.net/problem/11973 11973번: Angry Cows (Silver) The first line of input contains \(N\) (\(1 \leq N \leq 50,000\)) and \(K\) (\(1 \leq K \leq 10\)). The remaining \(N\) lines all contain integers \(x_1 \ldots x_N\) (each in the range \(0 \ldots 1,000,000,000\)). www.acmicpc.net Binary Search 폭발 반경 R을 기준으로 모든 hay bales 를 다 터뜨리기 위해 발사해야 할 소의 갯수가 K보다 작거나 같으면 hi를 낮추고, K보다 크면 .. 이전 1 ··· 7 8 9 10 11 12 13 14 다음