답안 #677911

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
677911 2023-01-04T15:26:10 Z qwerasdfzxcl 송금 (JOI19_remittance) C++17
0 / 100
1 ms 340 KB
#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<1;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;
}

Compilation message

remittance.cpp: In function 'int main()':
remittance.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
remittance.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |         scanf("%d %d", &x, &y);
      |         ~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
7 Correct 0 ms 296 KB Output is correct
8 Correct 1 ms 296 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 0 ms 300 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Incorrect 1 ms 212 KB Output isn't correct
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
7 Correct 0 ms 296 KB Output is correct
8 Correct 1 ms 296 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 0 ms 300 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Incorrect 1 ms 212 KB Output isn't correct
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
7 Correct 0 ms 296 KB Output is correct
8 Correct 1 ms 296 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 0 ms 300 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Incorrect 1 ms 212 KB Output isn't correct
17 Halted 0 ms 0 KB -