# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
335253 | 2020-12-11T17:35:51 Z | fadi57 | Combo (IOI18_combo) | C++14 | 0 ms | 0 KB |
//#include "combo.h" #include <bits/stdc++.h> #include"grader.cpp" using namespace std; std::string guess_sequence(int N) { std::string p = ""; string s[4]={"A","B","X","Y"}; string first; for(int i=0;i<4;i++){ p=s[i]; int ok=press(p); //cout<<ok; if(ok==1){ first=s[i]; break; } } string ret=first; S=first; //S=first; //ret+="B"; //cout<<ret<<endl; int si=N;si--; int now=2; while(si){ for(int i=0;i<4;i++){ if(s[i]==first){continue;} int ok=press(ret+s[i]); if(ok==now){ ret+=s[i]; now++; break; } }si--; } return ret; }