제출 #301799

#제출 시각아이디문제언어결과실행 시간메모리
301799DovranCombo (IOI18_combo)C++11
0 / 100
1 ms200 KiB
#include <bits/stdc++.h>
#include "combo.h"

#define N 100009
#define pii pair <int, int>
#define ff first
#define sz() size()
#define ss second
#define pb push_back
#define ll long long

using namespace std;

char c[5]={'X', 'Y', 'A', 'B'};
/*
int press(string ss){
	cout<<ss<<'\n';
	int y;
	cin>>y;
	return y;
}
*/
string guess_sequence(int n){
	string s;
	int in=-1;
	s+="AB";
	int x=press(s);
	if(x){
		s='A';
		in=3;
		x=press(s);
		if(x)
			in=2;
	}
	else{
		s='X';
		in=1;
		x=press(s);
		if(x)
			in=0;	
	}
	s[0]=c[in];
	swap(c[in], c[3]);
	for(int i=1; i<n; i++){
		string a=s+c[0]+s+c[1]+c[0]+s+c[1]+c[1]+s+c[1]+c[2];
		x=press(s);
		if(x==i+1)
			s+=c[0];
		else if(x==i+2)
			s+=c[1];
		else
			s+=c[2];
	}
	return s;
}
/*
int main(){
	int n;
	cin>>n;
	cout<<guess_sequence(n);
}*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...