제출 #301814

#제출 시각아이디문제언어결과실행 시간메모리
301814Dovran콤보 (IOI18_combo)C++14
5 / 100
1 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" #define N 100009 #define pii pair <int, int> #define ff first #define sz() size() #define ss second #define pb push_back #define ll long long using namespace std; char c[5]={'X', 'Y', 'A', 'B'}; string a; /* int press(string ss){ cout<<ss<<'\n'; int y; cin>>y; return y; } */ string guess_sequence(int n){ string s; int in=-1; s+="AB"; int x=press(s); if(x){ s='A'; in=3; x=press(s); if(x) in=2; } else{ s='X'; in=1; x=press(s); if(x) in=0; } s=c[in]; swap(c[in], c[3]); for(int i=1; i<n-1; i++){ a=s+c[0]+s+c[1]+c[0]+s+c[1]+c[1]+s+c[1]+c[2]; x=press(a); if(x==i+1) s+=c[0]; else if(x==i+2) s+=c[1]; else s+=c[2]; } a=s+c[0]; x=press(a); if(x==n) return a; a=s+c[1]; x=press(a); if(x==n) return a; s+=c[2]; return s; } /* int main(){ int n; cin>>n; cout<<guess_sequence(n); }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...