제출 #1117920

#제출 시각아이디문제언어결과실행 시간메모리
1117920adaawf콤보 (IOI18_combo)C++17
0 / 100
1 ms504 KiB
#include <iostream> using namespace std; int press(string s); char a[] = {'A', 'B', 'X', 'Y'}; string guess_sequence(int n) { 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]; for (int i = 2; i < n; i++) { int h = press(s + a[0] + 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...