Submission #312237

#TimeUsernameProblemLanguageResultExecution timeMemory
312237sofapudenRemittance (JOI19_remittance)C++14
0 / 100
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n), b(n); for(int i = 0; i < n; ++i)cin >> a[i] >> b[i]; for(int j = 0; j < 100; ++j){ for(int i = 0; i < n; ++i){ if(a[i] > b[i]){ a[(i+1)%n]+=(a[i]-b[i]+1)>>1; a[i]-=(((a[i]-b[i]+1)>>1)<<1); } } } cout << (a==b ? "Yes\n" : "No\n"); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...