Submission #647864

#TimeUsernameProblemLanguageResultExecution timeMemory
647864TruitadepatatesCave (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(int S[]); if (a == -1){ for (int i = 0; i < n; i++){ S[i] = 1; D[i] = tryCombination(int S[]); S[i] = 0; } } else{ for (int i = 0; i < n; i++){ D[i] = i; } while (a < n) { S[a] = 1; a = tryCombination(int S[]); (if a == -1) break; } } answer(int S[], int D[]) return 0; }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:12:26: error: expected primary-expression before 'int'
   12 |   int a = tryCombination(int S[]);
      |                          ^~~
cave.cpp:16:29: error: expected primary-expression before 'int'
   16 |       D[i] = tryCombination(int S[]);
      |                             ^~~
cave.cpp:26:26: error: expected primary-expression before 'int'
   26 |       a = tryCombination(int S[]);
      |                          ^~~
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:10: error: expected primary-expression before 'int'
   30 |   answer(int S[], int D[])
      |          ^~~
cave.cpp:30:19: error: expected primary-expression before 'int'
   30 |   answer(int S[], int D[])
      |                   ^~~