# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
540135 | Ronin13 | Combo (IOI18_combo) | C++14 | 37 ms | 548 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>
#define ll long long
#define ull unsigned ll
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define epb emplace_back
using namespace std;
const int inf = 1e9 + 1;
const ll linf = 1e18 + 1;
const int mod = 1e9 + 7;
std::string guess_sequence(int N) {
int n=N;
string cur = "";
int c = press("AB");
if(c >= 1){
c = press("A");
if(c == 1)cur += 'A';
else cur += 'B';
}
else{
c = press("X");
if(c == 1)cur += "X";
else cur += 'Y';
}
vector<char>s;
if(cur[0] != 'A')s.pb('A');
if(cur[0] != 'B')s.pb('B');
if(cur[0] != 'X')s.pb('X');
if(cur[0] != 'Y')s.pb('Y');
for(int i=2;i<n;i++){
string p="";
// p = cur;
for(int j = 0; j < 3; j++){
string x = "";
x += s[0];
x += s[j];
p += cur;
p += x;
}
p += cur;
p += s[1];
c = press(p);
if(c == i + 1){
cur += s[0];
}
if(c == i){
cur += s[1];
}
if(c < i){
cur += s[2];
}
}
if(cur.size() == n) return cur;
c = press(cur + s[0] + cur + s[1]);
if(c == n){
c = press(cur + s[0]);
if(c == n)cur += s[0];
else cur += s[1];
}
else cur += s[2];
return cur;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |