제출 #299600

#제출 시각아이디문제언어결과실행 시간메모리
299600Batyr콤보 (IOI18_combo)C++17
100 / 100
39 ms604 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; #define pb push_back #define ff first #define ss second #define sz(a) (int)a.size() typedef long long ll; typedef vector<int> vi; typedef pair<int,int> pii; const ll inf=1e18; const int mod=1e9+7; const int maxn=1e5; string s; vector<char>v; string guess_sequence(int N){ int jog = press("AB"); if(jog==2) s+='A'; else if(jog==1){ if(press("A")==1) s += 'A'; else s += 'B'; } else { if(press("X")==1) s += 'X'; else s += 'Y'; } if(s[0]=='A') v={'B','X','Y'}; else if(s[0]=='B') v={'A','X','Y'}; else if(s[0]=='X') v={'A','B','Y'}; else v={'A','B','X'}; for(int i = 1;i < N-1;i++){ string ask=""; ask += s+v[0]+v[0]; ask += s+v[0]+v[1]; ask += s+v[0]+v[2]; ask += s+v[1]; int now = press(ask); if(now == sz(s) + 2) s+=v[0]; else if(now == sz(s) + 1) s+=v[1]; else s += v[2]; } if(N > 1){ if(press(s+v[0])==sz(s)+1) s += v[0]; else if(press(s+v[1])==sz(s)+1) s += v[1]; else s += v[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...