제출 #1105670

#제출 시각아이디문제언어결과실행 시간메모리
1105670jadai007동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int N) { int swi[N] = {0}, door[N] = {0}, tmp[N] = {0}, state[N] = {0}; for(int i = 0; i < N; ++i){ int l = 0, r = N - 1; int ck = tryCombination(swi); int open = (ck == -1 || ck > i); while(l < r){ int mid = (l + r) >> 1; tmp = swi; for(int j = l; j <= mid; ++j) if(!state[i]) tmp[i]^=1; if(open){ if(tryCombination(tmp) == i) r = mid; else l = mid + 1; } else{ int ck = tryCombination(tmp); if(ck > i || ck == -1) r = mid; else l = mid + 1; } } door[r] = i; state[r] = 1; if(!open) swi[r]^=1; } answer(swi, door); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:14:17: error: invalid array assignment
   14 |             tmp = swi;
      |             ~~~~^~~~~