Submission #164399

#TimeUsernameProblemLanguageResultExecution timeMemory
164399aggu_01000101Combo (IOI18_combo)C++14
5 / 100
49 ms572 KiB
#include <combo.h> #include <bits/stdc++.h> using namespace std; string guess_sequence(int n){ string lol[] = {"A", "B", "X", "Y"}; vector<string> t; int taken = 0; int xyz = press(lol[0]+lol[1]); if(xyz==0){ xyz = press(lol[2]); if(xyz) taken = 2; else taken = 3; } else{ xyz = press(lol[0]); if(xyz) taken = 0; else taken = 1; } for(int i = 0;i<4;i++){ if(i==taken) continue; t.push_back(lol[i]); } string s = lol[taken]; for(int i = 1;i<(n-1);i++){ int lol1 = press(s + t[0] + s + t[1] + t[0] + s + t[1] + t[2] + s + t[1] + t[1]); if(lol1==i){ s+=t[2]; } else if(lol1==(i+1)){ s+=t[0]; } else{ s+=t[1]; } } if(n==1) return s; taken = 0; xyz = press(s + lol[0] + s + lol[1]); if(xyz==n){ xyz = press(s+lol[0]); if(xyz==n) taken = 0; else taken = 1; } else{ xyz = press(s+lol[2]); if(xyz==n) taken = 2; else taken = 3; } s+=lol[taken]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...