# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
62835 | mhnd | Cave (IOI13_cave) | C++14 | 420 ms | 596 KiB |
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;
typedef long long ll;
typedef unsigned long long ull;
const int N = 2e5+50;
const ll oo = 1e18;
const ll mod = 1e9+7;
int s[5010],d[5010],tmp[5010];
bool vis[5010];
void exploreCave(int n){
for(int i=0;i<n;i++){
int md,lo=0,hi=n-1,ans=0;
int to = tryCombination(s);
int t = (to>i || to==-1)?0:1;
while(lo!=hi){
md = (lo+hi)/2;
for(int i=lo;i<=md;i++)if(!vis[i])s[i]=!s[i];
to = tryCombination(s);
for(int i=lo;i<=md;i++)if(!vis[i])s[i]=!s[i];
int c = (to>i || to==-1)?0:1;
if(c != t)hi = md;
else lo = md+1;
}
s[lo]=t;
d[lo]=i;
Compilation message (stderr)
# | 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... |