| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1289189 | m.zeeshanrashid | Cave (IOI13_cave) | C++20 | 0 ms | 0 KiB |
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int n) {
vector<int>ans(n,-1);
for(int i=0;i<n;i++){
int l=0,r=n;
while(l+1<r){
int m=(l+r)/2;
vector<int>qu(n,0);
for(int j=0;j<n;j++){
if(ans[j]>-1 or (i>=l and i<=m)) qu[j]=0;
else qu[j]=1;
}
if(tryCombination(qu)>=i) r=m+1;
else l=m+1;
}
ans[l]=i;
}
answer(ans);
}
