# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
390298 | Marceantasy | Combo (IOI18_combo) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
const int mxN = 2e5, M = 1e9+7;
int N;
int press(string s){
int points = 0;
return points;
}
string guess_sequence(int N){
string sequence = "";
string chars = "ABXY";
if(press("AB")){
if(press("A")){
sequence+="A";
chars.erase(chars.find("A"), 1);
}else{
sequence+="B";
chars.erase(chars.find("B"), 1);
}
}else{
if(press("X")){
sequence+="X";
chars.erase(chars.find("X"), 1);
}else{
sequence+="Y";
chars.erase(chars.find("Y"), 1);
}
}
int val = 1;
for(int i = 1; i<N; ++i){
int points = press(sequence+chars[0]+sequence+chars[1]+chars[0]+sequence+chars[1]+chars[1]+sequence+chars[1]+chars[2]);
if(points == i){
sequence+=chars[2];
}else if(points == i+1){
sequence+=chars[0];
}else{
sequence+=chars[1];
}
val++;
}
if(press(sequence+chars[0]+sequence+chars[1]) == val+1){
if(press(sequence+chars[0])){
sequence+=chars[0];
}else{
sequence+=chars[1];
}
}else{
sequence+=chars[2];
}
return sequence;
}
int main(){
cin >> N;
guess_sequence(N);
}