# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1104037 | asdfghjk | Combo (IOI18_combo) | C++14 | 3 ms | 592 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>
#define ll long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define F first
#define ld long double
#define S second
using namespace std;
const ll N = 5e3 + 5;
const ll NN = 4e5 + 5;
const ll INF = 1e18;
const ll inf = 1e9;
const ll MOD = 1e9 + 7;
int press(std::string p);
string find_second(){
string d = "ABX";
int res = press(d);
if(res == 3)return d;
if(res == 2){
res = press("AB");
if(res == 2)return "AB";
res = press("AX");
if(res == 2)return "AX";
res = press("BX");
if(res == 2)return "BX";
}
if(res == 1){
res = press("AY");
if(res == 2)return "AY";
res = press("BY");
if(res == 2)return "BY";
res = press("XY");
if(res == 2)return "XY";
}
res = press("YA");
if(res == 2)return "YA";
res = press("YB");
if(res == 2)return "YB";
res = press("YX");
if(res == 2)return "YX";
}
string guess_sequence(int n){
string a = "qwertythjyh";
string s = find_second();
for(int i = 2;i <= n;i++){
if(int(s.size()) > i)continue;
string d = s;
d += a[1];
d += a[2];
int z = press(d);
d = s;
d += a[2];
d += a[3];
int x= press(d);
if(z == s.size()){
s += a[3];
}
else if(x == s.size()){
s += a[1];
}
else s += a[2];
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |