제출 #759687

#제출 시각아이디문제언어결과실행 시간메모리
759687Andrey동굴 (IOI13_cave)C++14
0 / 100
312 ms392 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int n) { int ans[n]; int sw[n]; int idk[n]; for(int i = 0; i < n; i++) { sw[i] = -1; } int l,r,m,x; bool yeah; for(int i = 0; i < n; i++) { l = 0; r = n-1; x = tryCombination(sw); if(x == -1 || x > i) { yeah = true; } else { yeah = false; } while(l < r) { m = (l+r)/2; for(int j = 0; j < n; j++) { if(sw[j] != -1) { idk[j] = sw[j]; } else { if(j >= l && j <= m && sw[i] != -1) { idk[j] = 1; } else { idk[j] = 0; } } } if((tryCombination(sw) == i) == yeah) { r = m; } else { l = m+1; } } ans[i] = l; if(x == -1 || x > i) { sw[l] = 0; } else { sw[l] = 1; } } answer(sw,ans); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:8:9: warning: variable 'idk' set but not used [-Wunused-but-set-variable]
    8 |     int idk[n];
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...