Submission #759343

#TimeUsernameProblemLanguageResultExecution timeMemory
759343raysh07Combo (IOI18_combo)C++17
10 / 100
72 ms544 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

std::string guess_sequence(int N) {
//   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;
    
    string ans = "";
    vector<char> a = {'A', 'B', 'X', 'Y'};
    for (int i = 0; i < N; i++){
        pair <int, char> mx = make_pair(-1, 'A');
        
        for (auto x : a){
            string p = ans + x;
            int coins = press(p);
            mx = max(mx, make_pair(coins, x));
        }
        
        ans += mx.second;
    }
    
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...