제출 #1057129

#제출 시각아이디문제언어결과실행 시간메모리
1057129MrPavlito동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
void exploreCave(int N) { int n = N; int trenutnacomb[n]; int solved[n]; int rez[n]; for(int i=0; i<n; i++)trenutnacomb[i] = 0, solved[i] = 0, rez[i] = 0; for(int i=0; i<n; i++) { for(int j=0; j<n; j++)trenutnacomb[j] = solved[j]; int t = tryCombination(trenutnacomb); int l = 0; int r = n-1; while(l<r) { int mid = l+r >> 1; for(int j=l; j<= mid; j++)if(!solved[j])trenutnacomb[j] ^= 1; int p = tryCombination(trenutnacomb); bool pomoc; if((p == i && t == i)||(p!=i && t!=i))pomoc = true; else pomoc = false; if(pomoc)l = mid+1; else r = mid; t = p; } solved[l] = i; rez[l] = trenutnacomb[l]; if(p == i)rez[l] = (trenutnacomb[l]^1); } answer(rez, solved); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:10:17: error: 'tryCombination' was not declared in this scope
   10 |         int t = tryCombination(trenutnacomb);
      |                 ^~~~~~~~~~~~~~
cave.cpp:15:24: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   15 |             int mid = l+r >> 1;
      |                       ~^~
cave.cpp:27:12: error: 'p' was not declared in this scope
   27 |         if(p == i)rez[l] = (trenutnacomb[l]^1);
      |            ^
cave.cpp:29:5: error: 'answer' was not declared in this scope
   29 |     answer(rez, solved);
      |     ^~~~~~