| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 470005 | AdamGS | Combo (IOI18_combo) | C++14 | 1 ms | 200 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"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
string guess_sequence(int n) {
string c[]={"A", "B", "X", "Y"};
if(!press(c[0]+c[1])) {
swap(c[0], c[2]);
swap(c[1], c[3]);
}
if(!press(c[0])) swap(c[0], c[1]);
string ans=c[0];
for(int i=1; i<n-1; ++i) {
int x=press(ans+c[1]+ans+c[2]+c[1]+ans+c[2]+c[2]+ans+c[2]+c[3]);
if(x==ans.size()) {
ans+=c[3];
} else if(x==ans.size()+1) {
ans+=c[1];
} else {
ans+=c[2];
}
}
if(press(ans+c[1])==n) {
ans+=c[1];
} else if(press(ans+c[2])==n) {
ans+=c[2];
} else {
ans+=c[3];
}
return ans;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
