제출 #521647

#제출 시각아이디문제언어결과실행 시간메모리
521647Vovamatrix콤보 (IOI18_combo)C++14
100 / 100
47 ms616 KiB
#include <bits/stdc++.h> #include<combo.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define mt make_tuple #define fi first #define sc second #define th third #define fo fourth #define pii pair<int,int> #define pll pair<ll,ll> #define ldb double #define endl "\n" string guess_sequence(int n) { string rez; if(n==1) { if(press("A")) return "A"; if(press("B")) return "B"; if(press("X")) return "X"; return "Y"; } if(press("AB")) { if(press("A")) { rez="A"; for(int i=1;i<n-1;i++) { int x=press(rez+"B"+rez+"XB"+rez+"XY"+rez+"XX"); if(x==i) rez=rez+"Y"; else if(x==i+1) rez=rez+"B"; else rez=rez+"X"; } if(press(rez+"B")==n) return rez+"B"; if(press(rez+"X")==n) return rez+"X"; return rez+"Y"; } else { rez="B"; for(int i=1;i<n-1;i++) { int x=press(rez+"A"+rez+"XA"+rez+"XY"+rez+"XX"); if(x==i) rez=rez+"Y"; else if(x==i+1) rez=rez+"A"; else rez=rez+"X"; } if(press(rez+"A")==n) return rez+"A"; if(press(rez+"X")==n) return rez+"X"; return rez+"Y"; } } else { if(press("X")) { rez="X"; for(int i=1;i<n-1;i++) { int x=press(rez+"B"+rez+"AB"+rez+"AY"+rez+"AA"); if(x==i) rez=rez+"Y"; else if(x==i+1) rez=rez+"B"; else rez=rez+"A"; } if(press(rez+"B")==n) return rez+"B"; if(press(rez+"A")==n) return rez+"A"; return rez+"Y"; } else { rez="Y"; for(int i=1;i<n-1;i++) { int x=press(rez+"B"+rez+"XB"+rez+"XA"+rez+"XX"); if(x==i) rez=rez+"A"; else if(x==i+1) rez=rez+"B"; else rez = rez + "X"; } if(press(rez+"B")==n) return rez+"B"; if(press(rez+"X")==n) return rez+"X"; return rez+"A"; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...