문제 링크: https://www.acmicpc.net/problem/11976
11976번: Promotion Counting
Input consists of four lines, each containing two integers in the range 0..1,000,000. The first line specifies the number of bronze participants registered before and after the contest. The second line specifies the number of silver participants before and
www.acmicpc.net
Platinum레벨에서부터 시작해서, 바로 전 레벨에서 몇명이 올라왔는지 카운트함.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <bits/stdc++.h>
using namespace std;
int division[4][2], ans[3];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
for(int i = 0; i < 4; i++)
cin >> division[i][0] >> division[i][1];
for(int i = 4; i >= 1; i--) {
ans[i - 1] = division[i][1] - division[i][0];
division[i - 1][0] -= ans[i - 1];
}
for(int i = 0; i < 3; i++)
cout << ans[i] << '\n';
return 0;
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
'USACO > Bronze' 카테고리의 다른 글
백준 11978 Mowing the Field (USACO January 2016 Bronze 3번) (0) | 2020.02.27 |
---|---|
백준 11977 Angry Cows (USACO January 2016 Bronze 2번) (0) | 2020.02.27 |
백준 11972 Contaminated Milk (USACO December 2015 Bronze 3번) (0) | 2020.02.26 |
백준 11971 속도 위반 (USACO December 2015 Bronze 2번) (0) | 2020.02.26 |
백준 11970 Fence Painting (USACO December 2015 Bronze 1번) (0) | 2020.02.26 |