제출 #861363

#제출 시각아이디문제언어결과실행 시간메모리
861363imarn콤보 (IOI18_combo)C++17
5 / 100
1 ms420 KiB
#include<bits/stdc++.h> //#include "insects.h" #define f first #define s second #define pb push_back #define pii pair<int,int> #define ll long long using namespace std; int press(std::string p); string guess_sequence(int N){ string ans=""; string s[4]; if(press("A")==1)ans="A",s[0]="A",s[1]="B",s[2]="X",s[3]="Y"; else if(press("B")==1)ans="B",s[0]="B",s[1]="A",s[2]="X",s[3]="Y"; else if(press("X")==1)ans="X",s[0]="X",s[1]="B",s[2]="A",s[3]="Y"; else ans="Y",s[0]="Y",s[1]="B",s[2]="X",s[3]="A"; for(int i=2;i<=N-1;i++){ string now1 = ans+s[1]; string now2 = ans+s[2]+s[1]; string now3 = ans+s[2]+s[2]; string now4 = ans+s[2]+s[3]; string tt = now1+now2+now3+now4; int x = press(tt); if(x==i-1)ans = ans+s[3]; else if(x==i)ans = ans+s[1]; else ans = ans+s[2]; }if(press(ans+s[1])==N)return ans+s[1]; if(press(ans+s[2])==N)return ans+s[2]; else return ans+s[3]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...