Submission #837134

#TimeUsernameProblemLanguageResultExecution timeMemory
837134makanhuliaCave (IOI13_cave)C++17
100 / 100
540 ms536 KiB
#include "cave.h" // #include "graderlib.c" #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define ull unsigned long long #define pii pair<int, int> #define pll pair<ll, ll> #define fi first #define se second const int MAX_N = 5e3 + 5; int a[MAX_N], b[MAX_N], input; bool check[MAX_N]; void exploreCave(int N) { int cnt = 0; while (cnt < N) { for (int i = 0; i < N; i++) if (!check[i]) a[i] = 0; input = tryCombination(a); int id; if (input == -1 or input > cnt) id = 0; else id = 1; int l = 0, r = N - 1; while (l < r) { int len = 0, cnt2 = 0, m = -1; for (int i = 0; i < N; i++) if (!check[i]) a[i] = 1 - id; for (int i = l; i <= r; i++) if (!check[i]) len++; for (int i = l; i <= r; i++) { if (check[i]) continue; cnt2++; m = i; a[i] = id; if (cnt2 == len / 2) break; } if (len == 1) { l = m; break; } input = tryCombination(a); if (input == -1 or input > cnt) r = m; else l = m + 1; } check[l] = 1, a[l] = id, b[l] = cnt; cnt++; } answer(a, b); } // int main() { // int N; // N = init(); // exploreCave(N); // printf("INCORRECT\nYour solution did not call answer().\n"); // return 0; // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...