| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1337904 | uranhishig | 송금 (JOI19_remittance) | C++20 | 817 ms | 16068 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
int n;
cin >> n;
vector<int> a(n);
vector<int> b(n);
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
for (int tt = 0; tt < 100; tt++) {
for (int i = 0; i < n; i++) {
if (a[i] > b[i]) {
int val = min(a[i] / 2, (a[i] - b[i] + 1) / 2);
a[i] -= val * 2;
a[(i + 1) % n] += val;
}
}
}
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
cout << "No";
return 0;
}
}
cout << "Yes";
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
