제출 #594601

#제출 시각아이디문제언어결과실행 시간메모리
594601angelo_torres동굴 (IOI13_cave)C++17
13 / 100
25 ms612 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int n,s[5000],d[5000]; void getd(){ for(int i = 0; i < 5000; ++i){ s[i] = 1-s[i]; int dor = tryCombination(s); d[i] = dor, s[i] = 1-s[i]; } } void exploreCave(int N){ n = N; bool fl = 0; for(int i = 0; i < 5000; ++i) s[i] = 0; for(int i = 0; i < 5000; ++i){ int dor = tryCombination(s); if(dor == -1){ fl = 1; break; } int l = 0, r = n; while(r-l > 1){ int md = (l+r)>>1; for(int j = l; j < md; ++j) s[j] = 1-s[j]; int ndor = tryCombination(s); if(dor == ndor) l = md; else{ r = md; for(int j = l; j < md; ++j) s[j] = 1-s[j]; } } d[l] = dor, s[l] = 1-s[l]; } if(fl){ getd(); } answer(s,d); return; } // int main(){ // return 0; // }
#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...