Submission #956024

#TimeUsernameProblemLanguageResultExecution timeMemory
956024ASGA_RedSeaCombo (IOI18_combo)C++17
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; //int press(string s){cout<<"press : "<<s<<" : ";int r;cin>>r;return r;} string guess_sequence(int n){ string s,c = "ABXY"; int f = 0; for(int i = 0;i < 3;i++){ f = press(string(1,c[i])); if(f){s += c[i];c.erase(i,1);break;} } if(!f){s += c.back();c.pop_back();} for(int i = 1;i < n;i++){ string p = s; p += c[0]; string pp = s;pp += c[1]; for(int j = 0;j < 3;j++){p += pp;p += c[j];} int r = press(p); if(r == i + 1)s += c[0]; else if(r == i + 2)s += c[1]; else s += c[2]; } return s; } //int main(){int n;cin>>n;cout<<guess_sequence(n);return 0;}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...