제출 #989954

#제출 시각아이디문제언어결과실행 시간메모리
989954Acanikolic콤보 (IOI18_combo)C++14
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> #include "combo.h" #define pb push_back using namespace std; std::string guess_sequence(int N) { string sol; if(press(sol + 'A' + 'B')) { if(press(sol + 'A')) sol += 'A'; else sol += 'B'; }else { if(press(sol + 'X')) sol += 'X'; else sol += 'Y'; } if(N == 1) { return sol; } vector<char>vec; if(sol[0] != 'A') vec.pb('A'); if(sol[0] != 'B') vec.pb('B'); if(sol[0] != 'X') vec.pb('X'); if(sol[0] != 'Y') vec.pb('Y'); for(int i = 2; i <= N - 1; i++) { int X = press(sol + vec[0] + sol + vec[1] + vec[0] + sol + vec[1] + vec[1] + sol + vec[1] + vec[2]); int siz = (int)sol.size(); if(X == siz + 1) { sol += vec[0]; }else if(X == siz + 2) { sol += vec[1]; }else { sol += vec[2]; } } if(press(sol + "AB") == N) { if(press(sol + 'A') == N) sol += 'A'; else sol += 'B'; }else { if(press(sol + 'X') == N) sol += 'X'; else sol += 'Y'; } //cout << sol << endl; return sol; } //4 * (n - 2) + 7 = 4n - 1
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...