Submission #534340

#TimeUsernameProblemLanguageResultExecution timeMemory
534340MrDebooCombo (IOI18_combo)C++17
10 / 100
44 ms448 KiB
#include "combo.h" #include <bits/stdc++.h> // #define int long long using namespace std; std::string guess_sequence(int n) { char f[]={'A','B','X','Y'}; string s; for(auto &i:f){ string g; g+=i; if(press(g)!=0){s+=i;break;} } vector<char>v; for(auto &i:f)if(i!=s[0])v.push_back(i); for(int i=1;i<n;i++){ bool bl=0; for(int w=0;w<2;w++){ if(press(s+v[w])==i+1){ s+=v[w]; bl=1; break; } } if(!bl)s+=v.back(); } return s; // std::string p = ""; // for (int i = 0; i < 4 * N; ++i) { // p += 'A'; // } // int coins = press(p); // std::string S = ""; // for (int i = 0; i < N; ++i) { // S += 'A'; // } // return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...