제출 #127014

#제출 시각아이디문제언어결과실행 시간메모리
127014Bench0310동굴 (IOI13_cave)C++17
100 / 100
341 ms660 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int n) { vector<int> v; for(int i=0;i<n;i++) v.push_back(i); int s[n],d[n]; for(int o=0;o<n;o++) { for(int i=0;i<n-o;i++) s[v[i]]=0; int t=0; if(tryCombination(s)==o) t=1; for(int i=0;i<n-o;i++) s[v[i]]=t; int l=0,r=n-o+1; while(l<r-1) { int m=(l+r)/2; int now=l; for(int i=now;i<m;i++) s[v[i]]=1-t; if(tryCombination(s)==o) r=m; else l=m; for(int i=now;i<m;i++) s[v[i]]=t; } d[v[l]]=o; s[v[l]]=t; v.erase(v.begin()+l); } 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...