Submission #1049273

#TimeUsernameProblemLanguageResultExecution timeMemory
1049273MrDogMeatCombo (IOI18_combo)C++17
5 / 100
1 ms596 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int N) { string res = ""; vector<char> vec = {'A', 'B', 'X', 'Y'}; if(press("AB") >= 1) { if(press("A") == 1) { res += 'A'; vec.erase(vec.begin()); } else { res += 'B'; vec.erase(vec.begin() + 1); } } else { if(press("X") == 1) { res += 'X'; vec.erase(vec.begin() + 2); } else { res += 'Y'; vec.erase(vec.begin() + 3); } } for(int i = 2; i < N; i++) { string Try = res + vec[0] + res + vec[1] + vec[0] + res + vec[1] + vec[1] + res + vec[1] + vec[2]; int coins = press(Try); if(coins == i) res += vec[0]; else if(coins == i + 1) res += vec[1]; else res += vec[2]; } if(press(res + vec[0]) == N) res += vec[0]; else if(press(res + vec[1]) == N) res += vec[1]; else res += vec[2]; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...