# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
897909 | Sir_Ahmed_Imran | Cave (IOI13_cave) | C++17 | 472 ms | 600 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.
///~~~LOTA~~~///
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ff first
#define ss second
#define ll long long
#define append push_back
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int ran(){
ll o=rng();
o%=2;
o=(o+2)%2;
return o;
}
void exploreCave(int n){
int m,o,p,q,r,s[n],t[n],d[n];
for(int i=0;i<n;i++)
s[i]=d[i]=-1;
m=0;
while(m<n){
for(int j=0;j<1028;j++){
for(int i=0;i<n;i++)
if(d[i]<0)
s[i]=ran();
o=tryCombination(s);
if(o>=m){
m=o;
for(int i=0;i<n;i++)
t[i]=s[i];
}
if(o==-1){
m=n;
for(int i=0;i<n;i++)
t[i]=s[i];
}
}
for(int i=0;i<n;i++){
if(d[i]>=0) continue;
s[i]=t[i];
t[i]^=1;
o=tryCombination(t);
if(o==-1) o=n;
if(o<m) d[i]=o;
t[i]^=1;
}
}
answer(t,d);
}
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... |