Submission #550428

#TimeUsernameProblemLanguageResultExecution timeMemory
550428don2001Combo (IOI18_combo)C++17
0 / 100
0 ms208 KiB
#include <bits/stdc++.h> #define fast ios::sync_with_stdio(false); cin.tie(NULL); using namespace std; #include "combo.h" string guess_sequence(int n) { string ans; vector<char>v; int a=press("AB"); if(a>0){ int c=press("A"); if(c>0){ ans.push_back('A'); v.push_back('B');v.push_back('X');v.push_back('Y'); } else{ ans.push_back('B'); v.push_back('A');v.push_back('X');v.push_back('Y'); } } else{ int c=press("X"); if(c>0){ ans.push_back('X'); v.push_back('A');v.push_back('B');v.push_back('Y'); } else{ ans.push_back('Y'); v.push_back('A');v.push_back('B');v.push_back('X'); } } for(int i=1;i<n-1;i++){ string ask; ask+=ans; ask+=v[0]; ask+=ans; ask+=v[1];ask+=v[0]; ask+=ans; ask+=v[1];ask+=v[1]; ask+=ans; ask+=v[1];ask+=v[2]; if(press(ask)==i+2){ ans.push_back(v[1]); } else if(press(ask)==i+1){ ans.push_back(v[0]); } else{ ans.push_back(v[2]); } } bool f=1; for(int i=0;i<=1;i++){ string s=ans+v[i]; if(press(s)==n){ f=0; ans=s; } } if(f){ ans=ans+v[2]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...