제출 #83542

#제출 시각아이디문제언어결과실행 시간메모리
83542laptop_recai콤보 (IOI18_combo)C++11
0 / 100
1 ms200 KiB
//Bismillahirrahmanirrahim #include "combo.h" #include<bits/stdc++.h> #define fori(A,B,C) for(int A=B; A<C; ++A) #define ford(A,B,C) for(int A=B; A>=C; --A) #define fi first #define se second #define pb push_back #define pbp(A,B) pb({A,B}) #define pp(A,B) push({A,B}) using namespace std; typedef long long ll; typedef pair<int,int> ii; const int maxn = 1e6 +7, inf = 1e9 +7, mod = 1e9 +7; string guess_sequence(int N) { int k; string S,button,p; k = press("AB"); if(k == 2) S = 'A'; else if(k == 1) { if(press("A") == 1) S = "A", button = "BXY"; else S = "B", button = "AXY"; } else { if(press("X") == 1) S = "X", button = "ABY"; else S = "Y", button = "ABX"; } fori(i,1,N-1) { p = (S + button[0]) + (S + button[1] + button[0]) + (S + button[1] + button[1]) + (S + button[1] + button[2]); k = press(p); if(k == i) S += button[2]; else if(k == i+1) S += button[0]; else S += button[1]; } if(N == 1) return S; if(press(S + button[0]) == N) S += button[0]; else if (press(S + button[1]) == N) S += button[1]; else S += button[2]; return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...