Submission #154418

#TimeUsernameProblemLanguageResultExecution timeMemory
154418andreiomdCombo (IOI18_combo)C++11
30 / 100
59 ms540 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence (int N) { string S; char V[4] = {'A', 'B', 'X', 'Y'}; vector < int > A; for(int i = 1; i <= N; ++i) { if(i == 1) { int Ret = 0; for(int j = 0; j < 3; ++j) { S.push_back(V[j]); if(press(S) == i) { Ret = j; break; } else S.pop_back(); } if(S.empty()) { S.push_back(V[3]); Ret = 3; } for(int j = 0; j < 4; ++j) if(j != Ret) A.push_back(j); } else { for(int j = 0; j < 2; ++j) { S.push_back(V[A[j]]); if(press(S) == i) break; else S.pop_back(); } if((int)S.size() != i) S.push_back(V[A[2]]); } } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...