# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1067446 | dosts | Combo (IOI18_combo) | C++17 | 15 ms | 684 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "combo.h"
//Dost SEFEROĞLU
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define ff first
#define ss second
#define sp << " " <<
#define all(cont) cont.begin(),cont.end()
#define vi vector<int>
const int MOD = 1e9+7,inf = 2e18;
const int N = 1e5+50;
string guess_sequence(int32_t N) {
string cur;
char firstletter = 'Y';
vector<char> chars = {'A','B','X','Y'};
for (auto it : chars) {
string ss;
ss+=it;
if (press(ss)) {
firstletter = it;
break;
}
}
cur+=firstletter;
for (int i=2;i<=N-1;i++) {
string presser = cur;
presser+="B";
presser+=cur;
presser+="XB";
presser+=cur;
presser+="XY";
presser+=cur;
presser+="XX";
int v = press(presser);
if (v == cur.length()){
for (auto it : chars) if (it != 'X' && it != 'B' && it != firstletter) cur+=it;
}
else if (v == cur.length()+1) {
cur+="B";
}
else cur+="X";
}
for (auto it : chars) {
string curr = cur;
curr+=it;
if (press(curr) > cur.length()) {
cur+=it;
break;
}
}
return cur;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |