Submission #1346750

#TimeUsernameProblemLanguageResultExecution timeMemory
1346750samuelandrianoo_Combo (IOI18_combo)C++20
10 / 100
11 ms496 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

string guess_sequence(int n){
	ll len = n;
	string s = "";
	char arr[5] = {'A', 'B', 'X', 'Y'};
	for (ll i = 0; i <= n - 1; i++){
		bool yes = 0;
		for (ll j = 0; j < 4; j++){
			if (i != 0 && arr[j] == s[0]) continue;
			string guess = s + arr[j];
			// cout << guess << endl;
			ll ans = press(guess);
			if (ans == i + 1){
				s = guess;
				yes = 1;
				break;
			}
		}
	}
	return s;
}

/*
	panggil aja 4 * 2000
*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...