# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
641579 | Nursik | Combo (IOI18_combo) | C++14 | 51 ms | 464 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 <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <bitset>
using namespace std;
#define ll long long
const ll maxn = 2e3 + 1;
vector<char> v = {'A', 'B', 'X', 'Y'};
string guess_sequence(int n) {
string pref = "";
int get = press("AB");
if (get == 2){
pref += "AB";
}
else if (get == 1){
get = press("A");
if (get == 0){
pref += "B";
}
else{
pref += "A";
}
}
else{
get = press("XY");
if (get == 2){
pref += "XY";
}
else{
get = press("X");
if (get == 0){
pref += "Y";
}
else{
pref += "X";
}
}
}
for (int i = (int)pref.size(); i < n; ++i){
string a = pref + 'A' + pref + 'B';
get = press(a);
if (get == pref.size() + 1){
a = pref + 'A';
get = press(a);
if (get == pref.size() + 1)
pref += 'A';
else
pref += 'B';
}
else{
a = pref + 'X';
get = press(a);
if (get == pref.size() + 1)
pref += 'X';
else
pref += 'Y';
}
}
return pref;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |