| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 542843 | colossal_pepe | 송금 (JOI19_remittance) | C++17 | 1 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
typedef long long ll;
const int MAXN = 1e6;
int n;
ll a[MAXN + 5], b[MAXN + 5];
bool isEqual() {
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) return 0;
}
return 1;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
for (int i = 0; i < 100; i++) {
for (int j = 0; j < n; j++) {
int k = (j + 1) % n;
if (a[j] > b[j]) {
ll x = (a[j] - b[j]) / 2;
a[j] -= (2 * x);
a[k] += x;
}
}
}
cout << (isEqual() ? "Yes" : "No") << '\n';
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... | ||||
