제출 #716596

#제출 시각아이디문제언어결과실행 시간메모리
716596TahirAliyev콤보 (IOI18_combo)C++17
0 / 100
1 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string ans = ""; if(press("AB") == 1){ if(press("A") == 1){ ans += 'A'; } else{ ans += 'B'; } } else{ if(press("X") == 1){ ans += 'X'; } else{ ans += 'Y'; } } vector<char> v = {'A', 'B', 'X', 'Y'}; v.erase(find(v.begin(), v.end(), ans[0])); for (int i = 2; i <= N; i++) { string help = ""; help += ans; help += v[0]; for (int j = 0; j < 3; j++) { help += ans; help += v[1]; help += v[j]; } int coins = press(help); if(coins == i){ ans += v[0]; } else if(coins == i + 1){ ans += v[1]; } else{ ans += v[2]; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...