본문 바로가기

USACO/Bronze

백준 11976 Promotion Counting (USACO January 2016 Bronze 1번)

문제 링크: 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