Submission #296922

#TimeUsernameProblemLanguageResultExecution timeMemory
296922AMO5Combo (IOI18_combo)C++17
30 / 100
43 ms560 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define ii pair<int,int> #define fi first #define se second #define ll long long #define all(x) x.begin(),x.end() #define sz(x) (int)x.size() const int mxn = 1e5; const string t = "ABXY"; string guess_sequence(int N) { string s = ""; int ptr = 0; int dif = -1; while(ptr<N){ int cnt = 0; for(int i=0; i<4; i++){ if(i==dif)continue; if(cnt==2&&dif!=-1){ s=s+t[i]; if(ptr==0){ dif=i; } break; } if(cnt==3&&dif==-1){ s=s+t[i]; if(ptr==0){ dif=i; } break; } int now = press(s+t[i]); if(now==ptr+1){ s=s+t[i]; if(ptr==0){ dif=i; } break; } cnt++; } ptr++; } return s; } /* int main(){ //ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); guess_sequence(5); return 0; } // */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...