제출 #287781

#제출 시각아이디문제언어결과실행 시간메모리
287781Ozy콤보 (IOI18_combo)C++17
100 / 100
41 ms740 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (int i = (a); i <= (b); i++) #define debug(a) cout << #a << " = " << a << endl string st,prueba; char a,b,c; int p,n; string guess_sequence(int N) { n = N; prueba = "AB"; p = press(prueba); if (p == 1 || p == 2) { p = press("A"); if(p == 1) st = "A"; else st = "B"; } else { p = press("X"); if(p == 1) st = "X"; else st = "Y"; } a = 'A'; b = 'B'; c = 'X'; if (st[0] == 'A') a = 'Y'; else if (st[0] == 'B') b = 'Y'; else if (st[0] == 'X') c = 'Y'; if (n > 1) { rep(i,2,n-1) { prueba = st + b + st + c + a + st + c + b + st + c + c ; p = press(prueba); if (p == i-1) st += a; else if (p == i) st += b; else st += c; } prueba = st+a; p = press(prueba); if (p == n) st += a; else { prueba = st+b; p = press(prueba); if (p == n) st += b; else st += c; } } return st; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...