제출 #979213

#제출 시각아이디문제언어결과실행 시간메모리
979213rahidilbayramliCave (IOI13_cave)C++17
0 / 100
30 ms576 KiB
#include "cave.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define ld long double #define vl vector<ll> #define vi vector<int> #define pii pair<int, int> #define pll pair<ll, ll> #define all(v) v.begin(), v.end() #define pb push_back #define f first #define s second using namespace std; using namespace __gnu_pbds; typedef tree<pll, null_type, less<pll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; void exploreCave(int N) { int n = N, i, j; int isfound[n], f[n], sw[n], fa[n]; for(i = 0; i < n; i++) { f[i] = 0; isfound[i] = 0; sw[i] = 0; } for(i = 0; i < n; i++) { int ask = tryCombination(f); for(j = 0; j < n; j++) fa[j] = f[j]; int l = 0, r = n - 1; while(l <= r) { int mid = (l + r) / 2; for(j = l; j <= mid; j++) { if(!isfound[j]) fa[j] = 1 - f[j]; } int res = tryCombination(fa); int p1 = (ask == i), p2 = (res == i); if(p1 != p2) r = (l + r) / 2 - 1; else l = (l + r) / 2 + 1; } isfound[l] = 1; sw[l] = i; if(ask == i) f[l] = 1 - f[l]; for(j = 0; j < n; j++) f[j] = fa[j]; } answer(f, sw); }
#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...