(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #1092650

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

Compilation message (stderr)

coins.cpp: In function 'int* coin_flips(int*, int)':
coins.cpp:7:12: warning: address of local variable 'a' returned [-Wreturn-local-addr]
    7 |     return a;
      |            ^
coins.cpp:6:9: note: declared here
    6 |     int a[1] = { c };
      |         ^
coins.cpp: At global scope:
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:12:38: error: 'b' was not declared in this scope
   12 |     for (int i = 0; i < 64; i++) if (b[i]) c ^= i;
      |                                      ^