Submission #1186823

#TimeUsernameProblemLanguageResultExecution timeMemory
1186823yoruonivampCoins (IOI17_coins)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int[] coin_flips(int[] b, int c){ c--; b[c/8][c%8] = !b[c/8][c%8]; return b; } int find_coin(int[] b){ int cnt = 0; for(int i = 0; i < 8; i++){ for(int j = 0; j < 8; j++){ if(b[i][j]) cout << i*8+j+1 << endl, return; } } }

Compilation message (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:14:16: error: 'b' was not declared in this scope
   14 |             if(b[i][j]) cout << i*8+j+1 << endl, return;
      |                ^
coins.cpp:14:50: error: expected primary-expression before 'return'
   14 |             if(b[i][j]) cout << i*8+j+1 << endl, return;
      |                                                  ^~~~~~
coins.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^