본문 바로가기

분류 전체보기

(111)
백준 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..
백준 15592 Blocked Billboard II (USACO January 2018 Bronze 1번) 문제 링크: https://www.acmicpc.net/problem/15592 15592번: Blocked Billboard II The first line of input contains four space-separated integers: $x_1$ $y_1$ $x_2$ $y_2$, where $(x_1, y_1)$ and $(x_2, y_2)$ are the coordinates of the lower-left and upper-right corners of the lawnmower billboard in Bessie's 2D field of view. The next lin www.acmicpc.net 처음 입력받은 직사각형을 먼저 1로 배열에 입력받고, 다음 직사각형을 2로 같은 배열에 입력..
백준 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..
백준 3035 스캐너 (COCI 2006/2007 Contest #4 2번) 문제 링크: https://www.acmicpc.net/problem/3035 3035번: 스캐너 문제 상근이는 매일 아침 영자 신문을 학교에 가져와서 읽는다. 하지만, 상근이의 눈은 점점 나빠졌고, 더 이상 아침 신문을 읽을 수 없는 상황에 이르렀다. 상근이는 스캐너를 이용해서 글자를 확대한 다음에 보려고 한다. 신문 기사는 글자로 이루어진 R*C 행렬로 나타낼 수 있다. 글자는 알파벳과 숫자, 그리고 마침표로 이루어져 있다. 스캐너는 ZR과 ZC를 입력으로 받는다. 이렇게 되면, 스캐너는 1*1크기였던 각 문자를 ZR*ZC크기로 확대해서 출력해 준 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 26 2..
백준 15464 The Bovine Shuffle (USACO December 2017 Bronze 2번) 문제 링크: https://www.acmicpc.net/problem/15464 15464번: The Bovine Shuffle The first line of input contains $N$, the number of cows. The next line contains the $N$ integers $a_1 \ldots a_N$. The final line contains the order of the $N$ cows after three shuffles, with each cow specified by its ID number. www.acmicpc.net 예제에 나와있듯이 1 3 4 5 2 라고 shuffle하는 순서가 주어져 있다면, 1번은 그대로, 3번은 2번으로, 4번은 3번으로, 5번은 4..
백준 15463 Blocked Billboard (USACO December 2017 Bronze 1번) 문제 링크: https://www.acmicpc.net/problem/15463 15463번: Blocked Billboard The first line of input contains four space-separated integers: $x_1$ $y_1$ $x_2$ $y_2$, where $(x_1, y_1)$ and $(x_2, y_2)$ are the coordinates of the lower-left and upper-right corners of the first billboard in Bessie's 2D field of view. The next line co www.acmicpc.net 두개의 빌보드를 먼저 1로 채운다음, 트럭을 0을 덮어 씌운뒤, 1의 갯수를 세면 됨. 1 2 3..
백준 3041 N-퍼즐 (COCI 2006/2007 Contest #3 2번) 문제 링크: https://www.acmicpc.net/problem/3041 3041번: N-퍼즐 문제 N-퍼즐은 많은 다양한 형태와 이름이 있다. 이번 문제에서 우리가 살펴볼 것은 15-퍼즐이다. 15-퍼즐은 4*4보드에서 움직일 수 있는 정사각형으로 이루어져 있고, 한 정사각형은 빠져있다. 정사각형은 A부터 O까지 이름이 붙여져 있다. 이 퍼즐을 풀면 다음과 같은 그림이 된다. A B C D E F G H I J K L M N O . 우리는 이러한 15-퍼즐에서 흩어짐 정도를 계산할 수 있다. 흩어짐 정도는 각 정사각형의 현재 위치와 퍼즐을 풀었을 www.acmicpc.net solved라는 배열에 완성된 퍼즐을 넣어놓고, 새로이 입력받은 puzzle이라는 배열과 비교하면 됨. 1 2 3 4 5 6..
백준 3047 ABC (COCI 2006/2007 Contest #2 2번) 문제 링크: https://www.acmicpc.net/problem/3047 3047번: ABC 문제 세 수 A, B, C가 주어진다. A는 B보다 작고, B는 C보다 작다. 세 수 A, B, C가 주어졌을 때, 입력에서 주어진 순서대로 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 세 수 A, B, C가 주어진다. 하지만, 순서는 A, B, C가 아닐 수도 있다. 세 수는 100보다 작거나 같은 자연수이다. 둘째 줄에는 A, B, C로 이루어진 세 글자가 주어지며, 이 순서대로 출력하면 된다. 출력 주어진 세 수를 주어진 출력 순서대로 출력하면 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 #include us..