Submission #484812

#TimeUsernameProblemLanguageResultExecution timeMemory
484812MohamedFaresNebiliCombo (IOI18_combo)C++14
30 / 100
68 ms256 KiB
#include <bits/stdc++.h> #pragma GCC optimize ("Ofast") #pragma GCC target ("avx2") #include "combo.h" using namespace std; using ll = long long; using vi = vector<int>; #define pb push_back #define ff first #define ss second #define lb lower_bound #define all(x) (x).begin() , (x).end() string guess_sequence(int N) { string lett = "ABXY"; string p = ""; int first = -1; for(int l = 0; l < 3; l++) { p = ""; for (int i = 0; i < N; ++i) p += lett[l]; if(press(p)) { first = l; break; } } if(first == -1) { first = 3; p[0] = lett[3]; } for(int i = 1; i < N; i++) { bool found = 0; for(int l = 0; l < 2; l++) { if(l == first) continue; p[i] = lett[l]; if(press(p) >= i+1) { found = 1; break; } } if(!found) { if(first == 2) p[i] = lett[3]; else if(first == 3) p[i] = lett[2]; else { p[i] = lett[2]; if(press(p) <= i) p[i] = lett[3]; } } } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...