제출 #1345312

#제출 시각아이디문제언어결과실행 시간메모리
1345312nanaseyuzuki콤보 (IOI18_combo)C++20
0 / 100
0 ms344 KiB
#include <bits/stdc++.h>
#include "combo.h"
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
using namespace std;

#ifdef LOCAL
#include "C:\Users\Dell\Downloads\template\template\icpc-notebook\Utilities\debug.h"
#else
#define debug(...) 42
#endif

const int mn = 5e5 + 5, mod = 1e9 + 7, inf = 2e9;

string s; 

string guess_sequence(int n) {
	int num = press("AB");
	char ban;
	if(num >= 1) {
		if(press("A") == 1) ban = 'A';
		else ban = 'B';
	}
	else {
		if(press("X") == 1) ban = 'X';
		else ban = 'Y';
	}
	s += ban;

	vector <char> all = {'A', 'B', 'X', 'Y'};
	auto it = find(all.begin(), all.end(), ban);
	if(it != all.end()) {
	    all.erase(it);
	}
	for(int i = 1; i < n; i ++) {
		for(int i = 0; i < 2; i++) {
			if(press(s + all[i]) == i + 1) s += all[i];	
		}
		if(s.size() == i) s += all[2];
	}
	return s;
}
// Don't wanna lose anymore T_T
// Never let me go - Kazuo Ishiguro
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...