# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
677905 | qwerasdfzxcl | 송금 (JOI19_remittance) | C++17 | 242 ms | 12188 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int n;
void NO(){
printf("No\n");
exit(0);
}
int main(){
scanf("%d", &n);
vector<int> a, b;
for (int i=0;i<n;i++){
int x, y;
scanf("%d %d", &x, &y);
a.push_back(x);
b.push_back(y);
}
for (int i=0;i<n;i++){
ll aS = 0, bS = 0;
for (int j=0;j<n;j++){
aS += (ll)a[j] * (1<<j);
bS += (ll)b[j] * (1<<j);
}
if (aS!=0 && bS==0) NO();
if (aS < bS) NO();
if ((aS - bS) % ((1LL<<n)-1) != 0) NO();
rotate(a.begin(), a.begin()+1, a.end());
rotate(b.begin(), b.begin()+1, b.end());
}
printf("Yes\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... |