제출 #1152179

#제출 시각아이디문제언어결과실행 시간메모리
1152179ace5Remittance (JOI19_remittance)C++20
0 / 100
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int64_t a[n],b[n]; for(int i = 0;i < n;++i) { cin >> a[i] >> b[i]; } int64_t tp = 0; for(int i = 0;i < 10*n;++i) { int j = i%n; a[j] += tp; if(a[j] > b[j]) { tp = (a[j]-b[j])/2; a[j] = b[j] + (a[j]-b[j])%2; } else tp = 0; } int no = 0; for(int i = 0;i < n;++i) { if(a[i] != b[i]) no = 1; } cout << (no ? "No\n" : "Yes\n"); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...