Submission #383948

#TimeUsernameProblemLanguageResultExecution timeMemory
383948alireza_kavianiCave (IOI13_cave)C++11
0 / 100
115 ms748 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; const int MAXN = (1 << 13) - 1; const int LOG = 13; int res[MAXN] , val[MAXN] , s[LOG][MAXN] , valid[MAXN]; void exploreCave(int N) { for(int i = 0 ; i < LOG ; i++){ for(int j = 0 ; j < N ; j++){ if(j & (1 << i)) s[i][j] = 1; } } for(int i = 0 ; i < N ; i++){ int ans = 0; for(int j = 0 ; j < LOG ; j++){ int cur = tryCombination(s[j]); if(cur > i) ans |= (1 << j); } int cur = tryCombination(valid); if(cur > i){ ans ^= MAXN; res[ans] = i; val[i] = 0; for(int j = 0 ; j < LOG ; j++) s[j][ans] = 0; } else{ res[ans] = i; val[i] = 1; valid[ans] = 1; for(int j = 0 ; j < LOG ; j++) s[j][ans] = 1; } } answer(valid , res); 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...