This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
#define worldssmallestviolin(i, a, b) for(int i = a; i < b; i++)
void exploreCave(int N) {
int somewhere[N], in[N], the[N];
worldssmallestviolin(universe,0,N) somewhere[universe]=the[universe]=-1;
worldssmallestviolin(someones,0,N) {
bool got;
worldssmallestviolin(it,0,N) in[it]=(bool)the[it];
int worse=tryCombination(in);
got=(worse>someones||worse==-1);
int wish=0,that=N;
while(that-wish>1) {
int made=(wish+that)/2;
worldssmallestviolin(easier,0,N) if(the[easier]==-1) in[easier]=(got==(wish<=easier&&easier<made));
worse=tryCombination(in);
if(worse>someones||worse==-1) that=made;
else wish=made;
}
somewhere[wish]=someones, the[wish]=got;
}
answer(the,somewhere);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |