| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 875617 | nasir_bashirov | Combo (IOI18_combo) | C++11 | 31 ms | 952 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>
using namespace std;
#define db long double
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define endl '\n'
#define all(x) x.begin(), x.end()
#define fastio\
ios_base::sync_with_stdio(0);\
cin.tie(0);\
cout.tie(0)\
string guess_sequence(int n) {
srand(time(0));
string res = "";
set<string> st = {"A", "B", "X", "Y"};
for(string s : {"A", "B", "X", "Y"}){
if(press(s)){
res = s;
st.erase(s);
break;
}
}
for(int i = 2; i <= n; i++){
while(true){
int ind = rand() % 3;
auto it = st.begin();
while(ind--) it++;
if(press(res + *it) == res.size() + 1){
res += *it;
break;
}
}
}
return res;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
