Submission #483278

#TimeUsernameProblemLanguageResultExecution timeMemory
483278MohamedAliSaidaneCave (IOI13_cave)C++14
0 / 100
182 ms400 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll> vll; #define pb push_back #define pop pop_back #define ff first #define ss second const ll MOD = 1e9 + 7; const ll INF = 1e18; int n; void exploreCave(int N) { n = N; int cb[n]; memset(cb,0,sizeof(cb)); int u = tryCombination(cb); int d[n]; memset(d,0,sizeof(d)); bool visited[n]; ll cnt = 0; memset(visited,false,sizeof(visited)); while(cnt < n) { for(int i = 0; i<n; i ++) { if(visited[i]) continue; cb[i] = 1; ll um = tryCombination(cb); if(um < u) { visited[i] = true; cb[i] = 0; d[um] = i; cnt ++; } else if(um > u) { visited[i] = true; d[um] = i; u = um; cnt ++; } else cb[i] = 0; } } answer(cb,d); return ; }
#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...