본문 바로가기

USACO/Bronze

(56)
백준 17028 Sleepy Cow Sorting (USACO January 2019 Bronze 2번) 문제 링크: https://www.acmicpc.net/problem/17028 17028번: Sleepy Cow Sorting Farmer John is attempting to sort his $N$ cows ($1 \leq N \leq 100$), conveniently numbered $1 \dots N$, before they head out to the pastures for breakfast. Currently, the cows are standing in a line in the order $p_1, p_2, p_3, \dots, p_N$, and Farmer Joh www.acmicpc.net 뒤에서부터 제대로 정렬이 된 갯수를 전체 갯수에서 빼면 됨. 1 2 3 4 5 6 7 8 9 1..
백준 17027 Shell Game (USACO January 2019 Bronze 1번) 문제 링크: https://www.acmicpc.net/problem/17027 17027번: Shell Game The first line of the input file contains an integer $N$ giving the number of swaps ($1 \leq N \leq 100$). Each of the next $N$ lines describes a step of the game and contains three integers $a$, $b$, and $g$, indicating that shells $a$ and $b$ were swappe www.acmicpc.net 처음에 pebble이 1번에 있을때, 2번에 있을때, 3번에 있을때 각각의 상황에 따라 맞은 guess의 갯수..
백준 16770 The Bucket List (USACO December 2018 Bronze 2번) 문제 링크: https://www.acmicpc.net/problem/16770 16770번: The Bucket List In this example, FJ needs 4 buckets: He uses buckets 1 and 2 for milking cow 3 (starting at time 2). He uses bucket 3 for milking cow 1 (starting at time 4). When cow 2 arrives at time 8, buckets 1 and 2 are now available, but not bucket 3, so he uses buck www.acmicpc.net 각 소마다의 time interval에 필요한 bucket수를 t 배열에 더해주고 나서, 최대값을 구..
백준 16769 Mixing Milk (USACO December 2018 Bronze 1번) 문제 링크: https://www.acmicpc.net/problem/16769 16769번: Mixing Milk The first line of the input file contains two space-separated integers: the capacity $c_1$ of the first bucket, and the amount of milk $m_1$ in the first bucket. Both $c_1$ and $m_1$ are positive and at most 1 billion, with $c_1 \geq m_1$. The second and t 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 ..
백준 15763 Team Tic Tac Toe (USACO US Open 2018 Bronze 1번) 문제 링크: https://www.acmicpc.net/problem/15763 15763번: Team Tic Tac Toe In this example, no single cow can claim victory. However, if cows C and X team up, they can win via the C-X-C diagonal. Also, if cows X and O team up, they can win via the middle row. www.acmicpc.net CCC CAA CAA 위의 예시에서와 같이, CCC가 첫번째 row와 첫번째 column에 총 두번 등장하지만, 한번만 세야함. set을 이용해서 중복을 쉽게 처리해줄수 있음. 1 2 3 4 5 6 7 8 9 10 11 12 1..
백준 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 ..