# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
297962 |
2020-09-12T08:35:55 Z |
Hemimor |
Cave (IOI13_cave) |
C++14 |
|
560 ms |
632 KB |
#include "cave.h"
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <cassert>
#include <vector>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
const int M=5000;
int a[M],b[M],perm[M];
void exploreCave(int N) {
int n=N;
fill(perm,perm+N,-1);
for(int i=0;i<n;i++){
if(tryCombination(a)==i){
for(int j=0;j<n;j++) if(perm[j]==-1) a[j]^=1;
}
int l=0,r=n;
while(r-l>1){
int m=(l+r)/2;
for(int j=0;j<n;j++){
if(perm[j]>=0||j<m) b[j]=a[j];
else b[j]=1-a[j];
}
if(tryCombination(b)==i) l=m;
else r=m;
}
perm[i]=l;
}
answer(a,perm);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
343 ms |
504 KB |
Output is correct |
2 |
Correct |
353 ms |
504 KB |
Output is correct |
3 |
Correct |
533 ms |
632 KB |
Output is correct |
4 |
Correct |
356 ms |
632 KB |
Output is correct |
5 |
Correct |
544 ms |
504 KB |
Output is correct |
6 |
Correct |
532 ms |
512 KB |
Output is correct |
7 |
Correct |
543 ms |
384 KB |
Output is correct |
8 |
Correct |
0 ms |
384 KB |
Output is correct |
9 |
Correct |
0 ms |
384 KB |
Output is correct |
10 |
Correct |
0 ms |
384 KB |
Output is correct |
11 |
Correct |
0 ms |
384 KB |
Output is correct |
12 |
Correct |
530 ms |
512 KB |
Output is correct |
13 |
Correct |
525 ms |
512 KB |
Output is correct |
14 |
Correct |
537 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
560 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Incorrect |
370 ms |
384 KB |
Answer is wrong |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
384 KB |
Output is correct |
3 |
Correct |
0 ms |
372 KB |
Output is correct |
4 |
Incorrect |
0 ms |
384 KB |
Answer is wrong |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
384 KB |
Output is correct |
3 |
Correct |
0 ms |
372 KB |
Output is correct |
4 |
Incorrect |
0 ms |
384 KB |
Answer is wrong |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
343 ms |
504 KB |
Output is correct |
2 |
Correct |
353 ms |
504 KB |
Output is correct |
3 |
Correct |
533 ms |
632 KB |
Output is correct |
4 |
Correct |
356 ms |
632 KB |
Output is correct |
5 |
Correct |
544 ms |
504 KB |
Output is correct |
6 |
Correct |
532 ms |
512 KB |
Output is correct |
7 |
Correct |
543 ms |
384 KB |
Output is correct |
8 |
Correct |
0 ms |
384 KB |
Output is correct |
9 |
Correct |
0 ms |
384 KB |
Output is correct |
10 |
Correct |
0 ms |
384 KB |
Output is correct |
11 |
Correct |
0 ms |
384 KB |
Output is correct |
12 |
Correct |
530 ms |
512 KB |
Output is correct |
13 |
Correct |
525 ms |
512 KB |
Output is correct |
14 |
Correct |
537 ms |
512 KB |
Output is correct |
15 |
Correct |
560 ms |
384 KB |
Output is correct |
16 |
Correct |
1 ms |
384 KB |
Output is correct |
17 |
Incorrect |
370 ms |
384 KB |
Answer is wrong |
18 |
Halted |
0 ms |
0 KB |
- |