| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1102410 | adiyer | Combo (IOI18_combo) | C++17 | 32 ms | 1832 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;
int press(std::string p);
string guess_sequence(int N){
string ans, cur, str;
int val = press("BA");
if(val){
if(press("A")) ans = "A", str = "BXY";
else ans = "B", str = "AXY";
}
else{
if(press("X")) ans = "X", str = "ABY";
else ans = "Y", str = "ABX";
}
for(int i = 1, it; i < N - 1; i++){
cur.clear();
cur += ans, cur.push_back(str[0]), cur.push_back(str[0]);
cur += ans, cur.push_back(str[0]), cur.push_back(str[1]);
cur += ans, cur.push_back(str[0]), cur.push_back(str[2]);
cur += ans, cur.push_back(str[1]);
it = press(cur);
if(it == i + 2){
ans.push_back(str[0]);
}
else if(it == i + 1){
ans.push_back(str[1]);
}
else{
ans.push_back(str[2]);
}
// for(auto it : ans) cout << it;
// cout << '\n';
}
if(ans.size() < N){
cur = ans, cur.push_back(str[0]);
if(press(cur) == N) return cur;
cur = ans, cur.push_back(str[1]);
if(press(cur) == N) return cur;
cur = ans, cur.push_back(str[2]);
return cur;
}
return ans;
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
