This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//============================================================================
// Name : ioi18p1.cpp
// Author : Daxi the Taxi
// Version :
// Copyright : ALL YOUR CODE IS BELONG TO US
// Description : Hello World in C++, Ansi-style
//============================================================================
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> p;
#ifndef ONLINE_JUDGE
int press(string s);
#endif
string guess_sequence(int n){
string curr = "", usable = "";
// Guessing first letter
int ret = press("AB");
if(ret){
ret = press("A");
if(ret)
curr = "A", usable = "BXY";
else
curr = "B", usable = "AXY";
}
else{
ret = press("X");
if(ret)
curr = "X", usable = "ABY";
else
curr = "Y", usable = "ABX";
}
// Rest of it
for (int i = 1; i < n; ++i) {
ret = press(curr + usable[0] + curr + usable[1]);
if(ret > i){
ret = press(curr + usable[0]);
if(ret > i)
curr += usable[0];
else
curr += usable[1];
}
else
curr += usable[2];
}
return curr;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |