Submission #1248080

#TimeUsernameProblemLanguageResultExecution timeMemory
1248080exoworldgdCombo (IOI18_combo)C++20
30 / 100
13 ms508 KiB
#pragma GCC optimize("O3")
#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
#include <bits/stdc++.h>
using namespace std;
int press(string s);
int ask(string s) {return press(s);}
string guess_sequence(int n) {
	string res= "";
	char c[4] = {'A','B','X','Y'},first;
    if (ask("A") > 0) first = 'A';
    else if (ask("B") > 0) first = 'B';
    else if (ask("X") > 0) first = 'X';
    else first = 'Y';
    res += first;
    vector<char> ch;
    for (char chr : c) if (chr != first) ch.push_back(chr);
    for (int i = 1; i< n; i ++) {
    	bool yes = 0;
    	for (int j =0 ; j < 2 && !yes; j++) {
    		string temp = res + ch[j];
    		if (ask(temp) == i+1) res += ch[j], yes = 1;
		}
		if (!yes) res += ch[2];
	}
	return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...