제출 #813190

#제출 시각아이디문제언어결과실행 시간메모리
813190I_Love_EliskaM_동굴 (IOI13_cave)C++17
0 / 100
424 ms412 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; #define forn(i,n) for(int i=0; i<n; ++i) #define pb push_back #define all(x) x.begin(), x.end() #define pi pair<int,int> #define f first #define s second using ll = long long; int ask(int q[]) { return tryCombination(q); } void exploreCave(int n) { int type[n], pos[n]; forn(it,n) { int q[n]; forn(i,n) q[i]=0; forn(i,it+1) q[pos[i]]=type[i]; int x=ask(q); if (x > it) type[it]=0; else type[it]=1; int l=0, r=n-1; while (l<r) { int mid=(l+r)>>1; int q[n]; forn(i,n) q[i]=type[i]^(i>mid); forn(i,it+1) q[pos[i]]=type[i]; int x=ask(q); if (x>it) r=mid; else l=mid+1; } pos[it]=r; } answer(pos,type); }
#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...