Submission #647866

#TimeUsernameProblemLanguageResultExecution timeMemory
647866TruitadepatatesCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "cave.h" void exploreCave(int n) { int S[n]; int D[n]; for (int i = 0; i < n; i++){ S[i] = 0; } int a = tryCombination(S); if (a == -1){ for (int i = 0; i < n; i++){ S[i] = 1; D[i] = tryCombination(S); S[i] = 0; } } else{ for (int i = 0; i < n; i++){ D[i] = i; } while (a < n) { S[a] = 1; a = tryCombination(S); (if a == -1) break; } } answer(S, D) return 0; }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:27:8: error: expected primary-expression before 'if'
   27 |       (if a == -1) break;
      |        ^~
cave.cpp:27:8: error: expected ')' before 'if'
   27 |       (if a == -1) break;
      |       ~^~
      |        )
cave.cpp:30:15: error: expected ';' before 'return'
   30 |   answer(S, D)
      |               ^
      |               ;
   31 |   return 0;
      |   ~~~~~~