Submission #1140983

#TimeUsernameProblemLanguageResultExecution timeMemory
1140983codexistentCoins (IOI17_coins)C++20
Compilation error
0 ms0 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; #define FOR(__i, __a, __b) for(ll __i = __a; __i <= __b; __i++) vector<int> coin_flips(vector<int> b, int c) { ll r = 0; FOR(i, 1, 63){ if(b[i]) r ^= i; } if(r != c) { FOR(i, 0, 63) if(r ^ i == c) b[i] = 1; } return flips; } int find_coin(vector<int> b) { ll r = 0; FOR(i, 1, 63){ if(b[i]) r ^= i; } return r; }

Compilation message (stderr)

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:7:5: error: 'll' was not declared in this scope
    7 |     ll r = 0;
      |     ^~
coins.cpp:8:9: error: expected ';' before 'i'
    8 |     FOR(i, 1, 63){
      |         ^
coins.cpp:4:35: note: in definition of macro 'FOR'
    4 | #define FOR(__i, __a, __b) for(ll __i = __a; __i <= __b; __i++)
      |                                   ^~~
coins.cpp:8:9: error: 'i' was not declared in this scope
    8 |     FOR(i, 1, 63){
      |         ^
coins.cpp:4:46: note: in definition of macro 'FOR'
    4 | #define FOR(__i, __a, __b) for(ll __i = __a; __i <= __b; __i++)
      |                                              ^~~
coins.cpp:9:18: error: 'r' was not declared in this scope
    9 |         if(b[i]) r ^= i;
      |                  ^
coins.cpp:12:8: error: 'r' was not declared in this scope
   12 |     if(r != c) {
      |        ^
coins.cpp:13:13: error: expected ';' before 'i'
   13 |         FOR(i, 0, 63) if(r ^ i == c) b[i] = 1;
      |             ^
coins.cpp:4:35: note: in definition of macro 'FOR'
    4 | #define FOR(__i, __a, __b) for(ll __i = __a; __i <= __b; __i++)
      |                                   ^~~
coins.cpp:13:13: error: 'i' was not declared in this scope
   13 |         FOR(i, 0, 63) if(r ^ i == c) b[i] = 1;
      |             ^
coins.cpp:4:46: note: in definition of macro 'FOR'
    4 | #define FOR(__i, __a, __b) for(ll __i = __a; __i <= __b; __i++)
      |                                              ^~~
coins.cpp:15:12: error: 'flips' was not declared in this scope
   15 |     return flips;
      |            ^~~~~
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:19:5: error: 'll' was not declared in this scope
   19 |     ll r = 0;
      |     ^~
coins.cpp:20:9: error: expected ';' before 'i'
   20 |     FOR(i, 1, 63){
      |         ^
coins.cpp:4:35: note: in definition of macro 'FOR'
    4 | #define FOR(__i, __a, __b) for(ll __i = __a; __i <= __b; __i++)
      |                                   ^~~
coins.cpp:20:9: error: 'i' was not declared in this scope
   20 |     FOR(i, 1, 63){
      |         ^
coins.cpp:4:46: note: in definition of macro 'FOR'
    4 | #define FOR(__i, __a, __b) for(ll __i = __a; __i <= __b; __i++)
      |                                              ^~~
coins.cpp:21:18: error: 'r' was not declared in this scope
   21 |         if(b[i]) r ^= i;
      |                  ^
coins.cpp:23:12: error: 'r' was not declared in this scope
   23 |     return r;
      |            ^