제출 #1210952

#제출 시각아이디문제언어결과실행 시간메모리
1210952LIACave (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
void exploreCave(int n) {
  ll s[n];
  loop(i,0,n) {
    s[i] = 0;
  }
  ll loc[n];
  vb of_prev(n, false);
  loop(i,0,n) {
    loop(j,0,n) {
     if (of_prev[j] == false) {
       ll cop[n];
       loop(c,0,n) cop[c] = s[c];
       cop[j] = 1;
       ll cs = tryCombination(s), ccop = tryCombination(cop);
       if (cs==-1) cs = n;
       if (ccop==-1) ccop = n;
       if (cs==i) {// if 1 is coorect here - ccop
         of_prev[j] = 1;
         s[j] = 1;
         loc[j] = i;
         break;
       }
       if (ccop==i) {// if 0 is coorect here - cs
         of_prev[j] = 1;
         s[j] = 0;
         loc[j] = i;
         break;
       }
     }
    }
  }
  answer(s, loc);
}

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:2:3: error: 'll' was not declared in this scope
    2 |   ll s[n];
      |   ^~
cave.cpp:3:8: error: 'i' was not declared in this scope
    3 |   loop(i,0,n) {
      |        ^
cave.cpp:3:3: error: 'loop' was not declared in this scope
    3 |   loop(i,0,n) {
      |   ^~~~
cave.cpp:6:5: error: expected ';' before 'loc'
    6 |   ll loc[n];
      |     ^~~~
      |     ;
cave.cpp:7:3: error: 'vb' was not declared in this scope
    7 |   vb of_prev(n, false);
      |   ^~
cave.cpp:32:10: error: 's' was not declared in this scope
   32 |   answer(s, loc);
      |          ^
cave.cpp:32:13: error: 'loc' was not declared in this scope
   32 |   answer(s, loc);
      |             ^~~
cave.cpp:32:3: error: 'answer' was not declared in this scope
   32 |   answer(s, loc);
      |   ^~~~~~