제출 #713408

#제출 시각아이디문제언어결과실행 시간메모리
713408lam콤보 (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; int n; string guess_sequence(int N) { n=N; string p = "AB"; int coins = press(p); char dau; if (coins>=1) { p="A"; coins = press(p); if (coins>=1) dau = 'A'; else dau = 'B'; } else { p="X"; coins = press(p); if (coins>=1) dau = 'X'; else dau = 'Y'; } string S=""; S+=dau; vector <char> tmp; if (dau!='A') tmp.push_back('A'); if (dau!='B') tmp.push_back('B'); if (dau!='X') tmp.push_back('X'); if (dau!='Y') tmp.push_back('Y'); for (int i=2; i+1<=n; i++) { p=""; p+=S+tmp[0]; for (char j:tmp) p+=S+tmp[1]+j; coins = press(p); if (coins==i) S+=tmp[0]; else if (coins>i) S+=tmp[1]; else S+=tmp[2]; } p=""; p+=S+tmp[0]; p+=S+tmp[1]; coins = press(p); if (coins==n) { p=""; p+=S+tmp[0]; coins = press(p); if (coins==n) S+=tmp[0]; else S+=tmp[1]; } else S+=tmp[2]; return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...