답안 #336841

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
336841 2020-12-17T01:55:23 Z blue 송금 (JOI19_remittance) C++11
0 / 100
1 ms 384 KB
#include <iostream>
using namespace std;

int main()
{
  	int N;
    cin >> N;
  
	int A[N], B[N];

    for(int i = 0; i < N; i++)
    {
        cin >> A[i] >> B[i];
    }

    for(int r = 1; r <= 5; r++)
    {
        for(int i = 0; i < N; i++)
        {
            if(A[i] - B[i] < 2) continue;
            int t = (A[i] - B[i])/2;
            A[i] -= 2*t;
            A[(i+1)%N] += t;
        }
    }
    for(int i = 0; i < N; i++) if(A[i] != B[i])
                               {
                                   cout << "No\n";
                                   return 0;
                               }
    cout << "Yes\n";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Incorrect 1 ms 384 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Incorrect 1 ms 384 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Incorrect 1 ms 384 KB Output isn't correct
9 Halted 0 ms 0 KB -