제출 #395314

#제출 시각아이디문제언어결과실행 시간메모리
395314grt콤보 (IOI18_combo)C++17
0 / 100
0 ms200 KiB
#include <bits/stdc++.h>
#include "combo.h"
#define PB push_back
#define ST first
#define ND second
#define _ ios_base::sync_with_stdio(0); cin.tie(0);
//mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

using namespace std;

using ll = long long;
using pi = pair<int,int>;
using vi = vector<int>;

string guess_sequence(int n) {
	char firstLet = 'x';
	if(press("AX") > 0) {
		if(press("A")) firstLet = 'A';
		else firstLet = 'X';
	} else {
		if(press("B")) firstLet = 'B';
		else firstLet = 'Y';	
	}
	string cur = to_string(firstLet);
	//4 * n -> s + 'B', s + 'X' + 'A'
	for(int i = 1; i < n; ++i) {
		int id = 0;
		string s = "";
		for(auto let : {'A', 'B', 'X', 'Y'}) {
			if(let == firstLet) continue;
			if(id == 0) {
				s += cur + let;
			} else if(id == 1) {
				for(auto let2 : {'A', 'B', 'X', 'Y'}) {
					if(let2 == firstLet) continue;
					s += cur + let + let2;
				}
			}
			id++;
		}
		int w = press(s);
		id = 0;
		for(auto let : {'A', 'B', 'X', 'Y'}) {
			if(w == i) {
				if(id == 2) cur += let; 
			} else if(w == i + 1) {
				if(id == 0) cur += let;
			} else {
				if(id == 1) cur += let;
			}
		}
	}
	return cur;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...