Submission #379868

#TimeUsernameProblemLanguageResultExecution timeMemory
379868sadCombo (IOI18_combo)C++14
10 / 100
183 ms296 KiB
#include "combo.h" #include<bits/stdc++.h> #define ll long long #define fi first #define se second using namespace std; char w; void go () { string s; s+='A'; if(press(s)){ w='A';return; } s[0]='B'; if(press(s)){ w='B';return; } s[0]='X'; if(press(s)){ w='X';return; } s[0]='Y'; if(press(s)){ w='Y';return; } } string guess_sequence(int n) { go(); string s; for(int i=0;i<n;i++)s+=w; int re=1; for(int i=1;i<n;i++) { re=i; int x=re; s[i]='A'; x=press(s); if(x>re)continue; s[i]='B'; x=press(s); if(x>re)continue; s[i]='X'; x=press(s); if(x>re)continue; s[i]='Y'; x=press(s); if(x>re)continue; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...