# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
220722 | DodgeBallMan | Remittance (JOI19_remittance) | C++14 | 41 ms | 1824 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long a[N], b[N];
int n;
int main()
{
scanf("%d",&n);
for( int i = 0 ; i < n ; i++ ) scanf("%lld %lld",&a[i],&b[i]);
for( int j = 1 ; j <= 30 ; j++ ) {
for( int i = 0 ; i < n ; i++ ) {
int nxt = ( i + 1 ) % n;
if( a[i] - b[i] >= 2 ) {
int d = ( a[i] - b[i] ) / 2;
a[i] -= 2*d;
a[nxt] += d;
}
else if( a[i] - b[i] == 1 && a[i] > 1 ) {
a[i] -= 2;
a[nxt] += 1;
}
}
}
for( int i = 0 ; i < n ; i++ ) if( a[i] ^ b[i] ) return !printf("No");
printf("Yes");
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... |