제출 #96272

#제출 시각아이디문제언어결과실행 시간메모리
96272figter001동굴 (IOI13_cave)C++14
0 / 100
449 ms512 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 5010; int s[maxn],d[maxn],f[maxn]; void exploreCave(int n){ for(int i=0;i<n;i++)f[i] = -1; for(int i=0;i<n;i++){ for(int j=0;j<n;j++)if(f[j] == -1)s[i] = 0; int to = tryCombination(s); bool ri = 0; if(to == i)ri = 1; for(int j=0;j<n;j++)if(f[j] == -1)s[i] = !ri; int md,lo=0,hi=n-1,at=0; while(lo <= hi){ md = (lo+hi)/2; for(int j=0;j<md;j++)if(f[j] == -1)s[i] = ri; to = tryCombination(s); for(int j=0;j<md;j++)if(f[j] == -1)s[i] = !ri; if(to == i){ lo = md+1; }else{ hi = md-1; at = md; } } d[i] = at; s[i] = ri; } answer(s,d); }
#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...