Submission #336842

# Submission time Handle Problem Language Result Execution time Memory
336842 2020-12-17T01:57:13 Z blue Remittance (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 = 0; r < N; 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";
}
# Verdict Execution time Memory 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 0 ms 364 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 0 ms 364 KB Output is correct
8 Incorrect 0 ms 364 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 0 ms 364 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 0 ms 364 KB Output is correct
8 Incorrect 0 ms 364 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 0 ms 364 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 0 ms 364 KB Output is correct
8 Incorrect 0 ms 364 KB Output isn't correct
9 Halted 0 ms 0 KB -