# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
134220 | reda | Combo (IOI18_combo) | C++14 | 58 ms | 448 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<bits/stdc++.h>
using namespace std ;
#define pb push_back
#define ll long long
#define ld long double
#define mp make_pair
#define MOD 1000000007
#define endl '\n'
#pragma GCC optimize ("O3")
#include "combo.h"
string guess_sequence(int N) {
char a[] = {'A', 'B', 'Y', 'X'};
char ban = 'X', def = 'A';
string cur;
int coins;
for(int i = 0; i < 3; i++)
if(press(string(1, a[i]))) {
ban = a[i];
def = a[(i+1)%4];
break;
}
cur = ban;
char c;
for(int k = 2; k <= N; k++) {
c = def;
for(int i = 0; i < 4; i++) {
if(a[i] == ban || a[i] == def) continue;
if(press(cur+a[i]) == k) {
c = a[i];
break;
}
}
cur += c;
}
return cur;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |