제출 #647957

#제출 시각아이디문제언어결과실행 시간메모리
647957JANCARAPAN콤보 (IOI18_combo)C++17
0 / 100
1 ms256 KiB
#include "combo.h" //#include <bits/stdc++.h> using namespace std; string ch = "ABXY"; string guess_sequence(int n) { string s = ""; string a = ""; int block = -1; if (press("A") == 1) block = 0; else if (press("B") == 1) block = 1; else if (press("X") == 1) block = 2; else block = 3; block = 1; s += ch[block]; for (int i=0; i<4; i++) { if (block == i) continue; a += ch[i]; } if (n == 1) return s; for (int i=1; i<n-1; i++) { int len = press(s+a[0]+s+a[1]+a[1]+s+a[1]+a[0]+s+a[1]+a[2]); if (len == i + 1) s += a[0]; else if (len == i + 2) s += a[1]; else s += a[2]; } if (press(s+a[0]) == n) return s+a[0]; else if (press(s+a[1]) == n) return s+a[1]; else return s+a[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...