제출 #516236

#제출 시각아이디문제언어결과실행 시간메모리
516236Jomnoi콤보 (IOI18_combo)C++17
5 / 100
1 ms284 KiB
#include <bits/stdc++.h> #include "combo.h" #define DEBUG 0 using namespace std; string guess_sequence(int N) { string res, s; // Find the first letter of string S if(press("A") == 1) { res += 'A'; s = "BXY"; } else if(press("B") == 1) { res += 'B'; s = "AXY"; } else if(press("X") == 1) { res += 'X'; s = "ABY"; } else { res += 'Y'; s = "ABX"; } // Solve other letter for(int i = 1; i < N - 1; i++) { int coins = press(res + s[0] + res + s[1] + s[0] + res + s[1] + s[1] + res + s[1] + s[2]); if(coins == i + 1) { res += s[0]; } else if(coins == i + 2) { res += s[1]; } else { res += s[2]; } } if(press(res + s[0]) == N) { res += s[0]; } else if(press(res + s[1]) == N) { res += s[1]; } else { res += s[2]; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...