제출 #75959

#제출 시각아이디문제언어결과실행 시간메모리
75959someone_aa콤보 (IOI18_combo)C++17
100 / 100
57 ms684 KiB
#include "combo.h" #include <bits/stdc++.h> #define pb push_back using namespace std; std::string guess_sequence(int N) { std::string p = ""; if(press("AB") >= 1) { if(press("A") == 1) p += "A"; else p += "B"; } else { if(press("X") == 1) p += "X"; else p += "Y"; } vector<char> letters; if(p[0] != 'A') letters.pb('A'); if(p[0] != 'B') letters.pb('B'); if(p[0] != 'X') letters.pb('X'); if(p[0] != 'Y') letters.pb('Y'); for(int i=2;i<=N;i++) { if(i < N) { string temp = p + letters[0] + letters[0]; string temp2 = p + letters[0] + letters[1]; string temp3 = p + letters[0] + letters[2]; string temp4 = p + letters[1]; string t = temp + temp2 + temp3 + temp4; int x = press(t); if(x == i) p += letters[1]; else if(x > i) p += letters[0]; else p += letters[2]; } else { if(press(p + letters[0]) == N) p += letters[0]; else if(press(p + letters[1]) == N) p += letters[1]; else p += letters[2]; } } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...