Submission #1093594

#TimeUsernameProblemLanguageResultExecution timeMemory
1093594IrateCoins (IOI17_coins)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
int[] coin_flips(int[] b, int c){
    int XOR = 0;
    for(int i = 0;i < 64;++i){
        if(b[i]){
            XOR ^= b[i];
        }
    }
    int res[1] = {XOR ^ c};
    return res;
}
int find_coin(int[] b){
    int XOR = 0;
    for(int i = 0;i < 64;++i){
        if(b[i]){
            XOR ^= b[i];
        }
    }
    return XOR;
}

Compilation message (stderr)

coins.cpp:3:4: error: structured binding declaration cannot have type 'int'
    3 | int[] coin_flips(int[] b, int c){
      |    ^~
coins.cpp:3:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
coins.cpp:3:4: error: empty structured binding declaration
coins.cpp:3:7: error: expected initializer before 'coin_flips'
    3 | int[] coin_flips(int[] b, int c){
      |       ^~~~~~~~~~
coins.cpp:13:21: error: expected ',' or '...' before 'b'
   13 | int find_coin(int[] b){
      |                     ^
coins.cpp: In function 'int find_coin(int*)':
coins.cpp:16:12: error: 'b' was not declared in this scope
   16 |         if(b[i]){
      |            ^