제출 #647864

#제출 시각아이디문제언어결과실행 시간메모리
647864Truitadepatates동굴 (IOI13_cave)C++14
컴파일 에러
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; }

컴파일 시 표준 에러 (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[])
      |                   ^~~