Submission #419387

#TimeUsernameProblemLanguageResultExecution timeMemory
419387TricksterCave (IOI13_cave)C++14
12 / 100
51 ms468 KiB
//Suleyman Atayew #include "cave.h" #include <algorithm> #include <iostream> #include <string.h> #include <stdio.h> #include <vector> #include <bitset> #include <queue> #include <cmath> #include <map> #include <set> #define maxN 200010 #define ff first #define ss second #define pb push_back #define ll long long #define mod 1000000007 #define pii pair <int, int> #define sz(a) (int)(a.size()) ll bigmod(ll a, ll b) { if(b==0)return 1; ll ret = bigmod(a, b/2); return ret * ret % mod * (b%2 ? a : 1) % mod; } using namespace std; pii arr[maxN]; void exploreCave(int n) { int s[n+1], d[n+1]; for(int i = 0; i < n; i++) arr[i].ff = -1; for(int i = 0; i < n; i++) { int cur[n+1]; for(int h = 0; h < n; h++) { if(arr[h].ff == -1) cur[h] = 0; else cur[h] = arr[h].ff; } int x = tryCombination(cur); int tp = 0; if(x == i) tp = 1; arr[i] = {tp, i}; } // for(int i = 0; i < n; i++) { // int cur[maxN]; // for(int h = 0; h < n; h++) { // if(arr[h].ff == -1) cur[h] = 0; // else cur[h] = arr[h].ss; // } // int x = tryCombination(cur); // int tp = 0; // if(x == i) tp = 1; // int l = 0, r = n-1, md, ans = 0; // while(l <= r) { // md = (l+r)/2; // int cur[maxN]; // for(int h = 0; h < n; h++) { // if(arr[h].ff != -1) cur[h] = arr[h].ss; // else if(h >= l && h <= md) cur[h] = tp; // else cur[h] = !tp; // } // int x = tryCombination(cur); // if(x > i) { // r = md-1; // ans = md; // } else { // l = md+1; // } // } // arr[ans] = {tp, i}; // } for(int i = 0; i < n; i++) s[i] = arr[i].ff, d[i] = arr[i].ss; answer(s, d); }
#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...