Submission #228899

#TimeUsernameProblemLanguageResultExecution timeMemory
228899chubyxdxdCave (IOI13_cave)C++17
13 / 100
18 ms512 KiB
#include "cave.h" #include <bits/stdc++.h> #define test tryCombination using namespace std; void exploreCave(int N) { int door[N],ans[N],vis[N]; memset(vis,0,sizeof vis); for(int i=0;i<N;i++){ ans[i]=0; door[i]=i; } int curr=test(ans); // cout<<curr<<endl; for(int i=0;i<N;i++){ if(curr==-1)break; for(int j=0;j<N;j++){ if(vis[j]==1)continue; ans[j]^=1; int pos=test(ans); if(pos<=curr){vis[j]=1;ans[i]^=1;} if(pos>curr){vis[j]=1;} } } reverse(ans,ans+N); for(int i=0;i<N;i++){ ans[i]^=1; int h=test(ans); door[i]=h; ans[i]^=1; } answer(ans,door); }
#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...