# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
513879 | Vladth11 | 송금 (JOI19_remittance) | C++14 | 405 ms | 36396 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << "\n"
#define debugs(x) cerr << #x << " " << x << " "
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
typedef pair <long double, pii> muchie;
const ll NMAX = 10000001;
const ll VMAX = 21;
const ll INF = (1LL << 60);
const ll MOD = 1000000007;
const ll BLOCK = 318;
const ll base = 31;
const ll nr_of_bits = 60;
ll a[NMAX];
ll b[NMAX];
ll n;
ll nxt(ll i){
i++;
if(i > n)
i = 1;
return i;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll i;
cin >> n;
ll needed = 0;
for(i = 1; i <= n; i++){
cin >> a[i] >> b[i];
}
for(ll tt = 1; tt <= nr_of_bits; tt++){
for(i = 1; i <= n; i++){
if(a[i] > b[i]){
ll total = (a[i] - b[i] + 1) / 2;
if(total * 2 > a[i])
total--;
a[i] -= total * 2;
a[nxt(i)] += total;
}
}
}
ll ok = 1;
for(ll i = 1; i <= n; i++){
if(a[i] != b[i])
ok = 0;
}
if(ok) cout << "Yes";
else cout << "No\n";
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |