# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97634 | tincamatei | Cave (IOI13_cave) | C++14 | 637 ms | 640 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;
const int MAX_N = 5000;
vector<int> pos;
int combination[MAX_N];
int S[MAX_N], D[MAX_N];
void exploreCave(int N) {
for(int i = 0; i < N; ++i)
pos.push_back(i);
for(int i = 0; i < N; ++i) {
for(auto it: pos)
combination[it] = 1;
int rez = tryCombination(combination);
bool correctState = false;
if(rez == -1 || rez > i)
correctState = true;
int st = -1, dr = pos.size() - 1;
while(dr - st > 1) {
int mid = (st + dr) / 2;
for(int i = 0; i <= mid; ++i)
combination[pos[i]] = correctState;
for(int i = mid + 1; i < pos.size(); ++i)
combination[pos[i]] = 1 - correctState;
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... |