Submission #162103

# Submission time Handle Problem Language Result Execution time Memory
162103 2019-11-06T11:46:14 Z Nordway Cave (IOI13_cave) C++14
46 / 100
26 ms 512 KB
#include "cave.h"

#include <bits/stdc++.h>

#define x first
#define y second
#define pb push_back
#define mp make_pair
#define sz(v) v.size()
#define all(v) v.begin(),v.end()

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

const int inf=2e9;
const int N=5111;

int a[N],d[N];

void exploreCave(int n){
  for(int i=0;i<n;i++){
    a[i]=0;
    d[i]=-1;
  }
  int x=tryCombination(a);
  while(1){
    if(x==-1)break;
    for(int i=0;i<n;i++){
      int y;
      if(d[i]==-1){
        a[i]=1;
        y=tryCombination(a);
        if(y<x)d[i]=y;
        if(y>x||y==-1){
          d[i]=x;
          x=y;
          break;
        }
        a[i]=0;
      }
    }
  }
  for(int i=0;i<n;i++){
    if(d[i]==-1){
      a[i]=1;
      x=tryCombination(a);
      d[i]=x;
      a[i]=0;
    }
  }
  answer(a,d);
}
# Verdict Execution time Memory Grader output
1 Correct 16 ms 384 KB Output is correct
2 Correct 17 ms 384 KB Output is correct
3 Correct 19 ms 384 KB Output is correct
4 Correct 19 ms 384 KB Output is correct
5 Correct 21 ms 384 KB Output is correct
6 Correct 26 ms 416 KB Output is correct
7 Correct 21 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 432 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 24 ms 372 KB Output is correct
13 Correct 23 ms 360 KB Output is correct
14 Correct 22 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 420 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 19 ms 432 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 21 ms 384 KB Output is correct
7 Correct 19 ms 432 KB Output is correct
8 Correct 25 ms 452 KB Output is correct
9 Correct 17 ms 460 KB Output is correct
10 Correct 18 ms 464 KB Output is correct
11 Correct 21 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 304 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 6 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 5 ms 384 KB Output is correct
14 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 304 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 6 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 5 ms 384 KB Output is correct
14 Correct 5 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 5 ms 384 KB Output is correct
19 Correct 5 ms 384 KB Output is correct
20 Incorrect 8 ms 384 KB too much calls on tryCombination()
21 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 16 ms 384 KB Output is correct
2 Correct 17 ms 384 KB Output is correct
3 Correct 19 ms 384 KB Output is correct
4 Correct 19 ms 384 KB Output is correct
5 Correct 21 ms 384 KB Output is correct
6 Correct 26 ms 416 KB Output is correct
7 Correct 21 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 432 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 24 ms 372 KB Output is correct
13 Correct 23 ms 360 KB Output is correct
14 Correct 22 ms 512 KB Output is correct
15 Correct 22 ms 420 KB Output is correct
16 Correct 6 ms 384 KB Output is correct
17 Correct 19 ms 432 KB Output is correct
18 Correct 5 ms 384 KB Output is correct
19 Correct 5 ms 384 KB Output is correct
20 Correct 21 ms 384 KB Output is correct
21 Correct 19 ms 432 KB Output is correct
22 Correct 25 ms 452 KB Output is correct
23 Correct 17 ms 460 KB Output is correct
24 Correct 18 ms 464 KB Output is correct
25 Correct 21 ms 384 KB Output is correct
26 Correct 5 ms 384 KB Output is correct
27 Correct 5 ms 384 KB Output is correct
28 Correct 5 ms 304 KB Output is correct
29 Correct 5 ms 384 KB Output is correct
30 Correct 5 ms 384 KB Output is correct
31 Correct 5 ms 384 KB Output is correct
32 Correct 5 ms 384 KB Output is correct
33 Correct 5 ms 384 KB Output is correct
34 Correct 6 ms 384 KB Output is correct
35 Correct 5 ms 384 KB Output is correct
36 Correct 5 ms 384 KB Output is correct
37 Correct 5 ms 384 KB Output is correct
38 Correct 5 ms 384 KB Output is correct
39 Correct 5 ms 384 KB Output is correct
40 Correct 5 ms 384 KB Output is correct
41 Correct 5 ms 384 KB Output is correct
42 Correct 5 ms 384 KB Output is correct
43 Correct 5 ms 384 KB Output is correct
44 Correct 5 ms 384 KB Output is correct
45 Incorrect 8 ms 384 KB too much calls on tryCombination()
46 Halted 0 ms 0 KB -