# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
167427 | 2019-12-08T14:32:28 Z | nikatamliani | Cave (IOI13_cave) | C++14 | 538 ms | 512 KB |
# include "cave.h" # include <bits/stdc++.h> using namespace std; void exploreCave(int N) { int x[N], y[N], fixed[N], ans[N]; for(int i = 0; i < N; i ++)fixed[i] = -1; for(int i = 0; i < N; i ++)x[i] = 0; for(int i = 0; i < N; i ++){ int l = 0, r = N - 1; int cur_x[N], res = 0; bool open; for(int j = 0; j < N; j ++)if(fixed[j] == -1)cur_x[j] = 1; else cur_x[j] = fixed[j]; if(tryCombination(cur_x) > i) open = 1; else open = 0; bool ok = false; while(l <= r){ if(l == r && ok == true) break; if(l == r)ok = true; int m = (l + r) >> 1; for(int j = l; j <= m; j ++) if(fixed[j] == -1) cur_x[j] = open; else cur_x[j] = fixed[j]; for(int j = 0; j < N; j ++) if(j < l || j > r){if(fixed[j] == -1) cur_x[j] = open ^ 1; else cur_x[j] = fixed[j];} if(tryCombination(cur_x) > i){ r = m; }else{ l = m + 1; } } res = l; ans[res] = i; fixed[res] = open; } answer(fixed, ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 267 ms | 500 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 538 ms | 512 KB | too much calls on tryCombination() |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 512 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 512 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 267 ms | 500 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |