Submission #660259

#TimeUsernameProblemLanguageResultExecution timeMemory
660259TruitadepatatesCoins (IOI17_coins)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "coins.h" int[] coins_flips(int[] b, int c){ int ans = 0; for (int i = 0; i < 64; i++){ if (b[i] == 1) ans ^= i; } ans ^= c; int[1] flip; flip[0] = ans; return flip; } int find_coin(int[]b){ int c = 0; for (int i = 0; i < 64; i++){ if (b[i] == 1) c ^= i; } return c; }

Compilation message (stderr)

coins.cpp:6:4: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
    6 | int[] coins_flips(int[] b, int c){
      |    ^
coins.cpp:6:4: error: structured binding declaration cannot have type 'int'
    6 | int[] coins_flips(int[] b, int c){
      |    ^~
coins.cpp:6:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
coins.cpp:6:4: error: empty structured binding declaration
coins.cpp:6:7: error: expected initializer before 'coins_flips'
    6 | int[] coins_flips(int[] b, int c){
      |       ^~~~~~~~~~~
coins.cpp:17:20: error: expected ',' or '...' before 'b'
   17 | int find_coin(int[]b){
      |                    ^
coins.cpp: In function 'int find_coin(int*)':
coins.cpp:20:9: error: 'b' was not declared in this scope
   20 |     if (b[i] == 1) c ^= i;
      |         ^