USACO/Silver (15) 썸네일형 리스트형 백준 12003 Diamond Collector (USACO US Open 2016 Silver 2번) 문제 링크: https://www.acmicpc.net/problem/12003 12003번: Diamond Collector (Silver) The first line of the input file contains \(N\) and \(K\) (\(0 \leq K \leq 1,000,000,000\)). The next \(N\) lines each contain an integer giving the size of one of the diamonds. All sizes will be positive and will not exceed \(1,000,000,000\). www.acmicpc.net 예시 7 3 10 5 1 12 9 5 14 1. 먼저 sort 함. => a = [1 5 5 9 10 1.. 백준 11996 Circular Barn (USACO February 2016 Silver 1번) 문제 링크: https://www.acmicpc.net/problem/11996 11996번: Circular Barn (Silver) Being a fan of contemporary architecture, Farmer John has built a new barn in the shape of a perfect circle. Inside, the barn consists of a ring of \(n\) rooms, numbered clockwise from \(1 \ldots n\) around the perimeter of the barn (\(3 \leq n \leq 1000\) www.acmicpc.net 비어있는 방을 찾아서 반시계 방향으로 제일 가까운 소로 채워넣으면 됨. 소를 옮길때마다 .. 백준 11975 Build Gates (USACO January 2016 Silver 3번) 문제 링크: https://www.acmicpc.net/problem/11975 11975번: Build Gates The first line of input contains \(N\) (\(1 \leq N \leq 1000\)). The next line contains a string of length \(N\) describing FJ's path. Each character is either N (north), E (east), S (south), or W (west). www.acmicpc.net BFS 방향 char를 하나 받을때마다 두칸씩 해당 방향으로 움직이면서 fence를 설치함. 다 설치하고 나서, fence가 없는곳에서 bfs를 실행시키고, 실행 횟수에서 1을 빼면 답임. 1 2 3 .. 백준 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이라는 .. 백준 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보다 크면 .. 백준 11969 Breed Counting (USACO December 2015 Silver 3번) 문제 링크: https://www.acmicpc.net/problem/11969 11969번: Breed Counting Farmer John's \(N\) cows, conveniently numbered \(1 \ldots N\), are all standing in a row (they seem to do so often that it now takes very little prompting from Farmer John to line them up). Each cow has a breed ID: 1 for Holsteins, 2 for Guernseys, and 3 www.acmicpc.net Prefix Sum 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19.. 백준 11968 High Card Wins (USACO December 2015 Silver 2번) 문제 링크: https://www.acmicpc.net/problem/11968 11968번: High Card Wins Bessie the cow is a huge fan of card games, which is quite surprising, given her lack of opposable thumbs. Unfortunately, none of the other cows in the herd are good opponents. They are so bad, in fact, that they always play in a completely predictable fas www.acmicpc.net E: 1 2 5 8 10 B: 3 4 6 7 9 처음 세판은 B 가 이긴다(3 > 1, 4 > 2, 6.. 이전 1 2 다음