제출 #148048

#제출 시각아이디문제언어결과실행 시간메모리
148048GodTe동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
void exploreCave(int N){
	int ans[5010] = {0,};
	int cntd[5010] = {0,};
	rep(i,5010){
		ans[i] = 0; cntd[i] = -1;
	}	
	rep(i,N){
		int l = 0; int r = N-1;
		while(l < r){
			int mid = (l+r)/2;
			for(int j = l; j <= mid; j++){
				if(cntd[j] == -1) ans[j] = 1-ans[j];
			}
			if(tryCombination(ans) > i) r = mid;
			else {
				for(int j = l; j <= r; j++) if(cntd[j] == -1) ans[j] = 1-ans[j];
				l = mid+1;
			}
		}
		cntd[l] = i;
	}
	answer(ans,cntd);
}

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:4:6: error: 'i' was not declared in this scope
  rep(i,5010){
      ^
cave.cpp:4:2: error: 'rep' was not declared in this scope
  rep(i,5010){
  ^~~
cave.cpp:22:2: error: 'answer' was not declared in this scope
  answer(ans,cntd);
  ^~~~~~
cave.cpp:22:2: note: suggested alternative: 'ans'
  answer(ans,cntd);
  ^~~~~~
  ans