Submission #1258220

#TimeUsernameProblemLanguageResultExecution timeMemory
1258220y8xc9uhjtCombo (IOI18_combo)C++20
5 / 100
20 ms492 KiB
#include <bits/stdc++.h>
#include "combo.h"
// #define int long long

using namespace std;

std::string guess_sequence(int N) {
  std::string p = "";
  
  while(true) {
    std::string q;
    q = p;
    
    p += "A";
    
    if(press(p) == p.length() && p.length() == N)
    break;
    
    else if(press(p) == p.length())
    continue;
    
    p = q;
    
    p += "B";
    
    if(press(p) == p.length() && p.length() == N)
    break;
    
    else if(press(p) == p.length())
    continue;
    
    p = q;
    
    p += "X";
    
    if(press(p) == p.length() && p.length() == N)
    break;
    
    else if(press(p) == p.length())
    continue;
    
    p = q;
    
    p += "Y";
    
    if(p.length() == N)
    break;
  }
  
  return p;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...