제출 #1117924

#제출 시각아이디문제언어결과실행 시간메모리
1117924adaawf콤보 (IOI18_combo)C++17
100 / 100
45 ms2124 KiB
#include <iostream> using namespace std; int press(string s); char a[] = {'A', 'B', 'X', 'Y'}; string guess_sequence(int n) { a[0] = 'A'; a[1] = 'B'; a[2] = 'X'; a[3] = 'Y'; int h = 0; if (press("AB")) { if (press("A")) h = 0; else h = 1; } else { if (press("X")) h = 2; else h = 3; } swap(a[h], a[3]); string s = ""; s += a[3]; if (n == 1) return s; for (int i = 2; i < n; i++) { int h = press(s + a[0] + s + a[1] + a[0] + s + a[1] + a[1] + s + a[1] + a[2]); h -= s.size(); if (h == 0) s += a[2]; else if (h == 1) s += a[0]; else s += a[1]; } if (press(s + a[0]) == n) return s + a[0]; if (press(s + a[1]) == n) return s + a[1]; return s + a[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...