제출 #445358

#제출 시각아이디문제언어결과실행 시간메모리
445358silverfishCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

#define pb push_back

set<char> st = {'A', 'B', 'X', 'Y'};

string guess_sequence(int n) {
	srand(time(0));
	string ans="";
	vector<char> c;
	for(char ch : st){
		if(press(ans+ch)){
			ans.pb(ch);	
			for(char cch : st) if(cch != ch) c.pb(cch);
			break;
		}
	}
	for(int i = 1; i < n; ++i){
		bool found = 0;
		for(int i = 0; i < 2; ++i){
			if(press(ans + c[i]) == i+1){
				found = 1;
				ans.pb(c[i]);
				break;
			}
		}
		if(!found) ans.pb(c[2]);
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...