Submission #301788

#TimeUsernameProblemLanguageResultExecution timeMemory
301788DovranCombo (IOI18_combo)C++11
30 / 100
56 ms436 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'}; /* 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[0]=c[in]; swap(c[in], c[3]); for(int i=1; i<n; i++){ s+='X'; in=0; for(int j=0; j<2; j++){ s[i]=c[j]; int x=press(s); if(x==i+1){ in=1; break; } } if(!in) s[i]=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...