제출 #1264509

#제출 시각아이디문제언어결과실행 시간메모리
1264509DeltaStructCoins (IOI17_coins)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int[] coin_flips(int b[],int c){ vector<int> R(b,b+64); int r(0); for (int i(0);i < 64;++i) r ^= b[i]*i; R[r] ^= 1; return R.data(); } int find_coin(int[] b){ int r(0); for (int i(0);i < 64;++i) r ^= b[i]*i; return r; }

컴파일 시 표준 에러 (stderr) 메시지

coins.cpp:4:4: error: structured binding declaration cannot have type 'int'
    4 | int[] coin_flips(int b[],int c){
      |    ^~
coins.cpp:4:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
coins.cpp:4:4: error: empty structured binding declaration
coins.cpp:4:7: error: expected initializer before 'coin_flips'
    4 | int[] coin_flips(int b[],int c){
      |       ^~~~~~~~~~
coins.cpp:10:21: error: expected ',' or '...' before 'b'
   10 | int find_coin(int[] b){
      |                     ^
coins.cpp: In function 'int find_coin(int*)':
coins.cpp:11:44: error: 'b' was not declared in this scope
   11 |   int r(0); for (int i(0);i < 64;++i) r ^= b[i]*i;
      |                                            ^