# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
78016 |
2018-10-01T19:27:49 Z |
MladenP |
Combo (IOI18_combo) |
C++17 |
|
1 ms |
200 KB |
#include<bits/stdc++.h>
#include "combo.h"
#define STIZE(x) fprintf(stderr, "STIZE%d\n", x);
#define PRINT(x) fprintf(stderr, "%s = %d\n", #x, x);
#define NL(x) printf("%c", " \n"[(x)]);
#define lld long long
#define pii pair<int,int>
#define pb push_back
#define fi first
#define se second
#define mid (l+r)/2
#define endl '\n'
#define all(a) begin(a),end(a)
#define sz(a) int((a).size())
#define LINF 1000000000000000LL
#define INF 1000000000
#define EPS 1e-9
using namespace std;
set<string> s;
string guess_sequence(int N) {
string P = "";
if(press("AB") >= 1) {
if(press("A")) P += 'A';
else P += 'B';
} else {
if(press("X")) P += 'X';
else P += 'Y';
}
s.insert("A"); s.insert("B"); s.insert("X"); s.insert("Y");
s.erase(string(1, P[0]));
string A = *s.begin(); s.erase(A);
string B = *s.begin(); s.erase(B);
string C = *s.begin(); s.erase(C);
while(sz(P) < N-1) {
int cur = press(P+A+A+P+A+B+P+A+C+P+B);
if(cur == sz(P)) P += C;
if(cur == sz(P)+1) P += B;
if(cur == sz(P)+2) P += A;
}
if(N != 1) {
if(press(A+B)) {
if(press(A)) P += A;
else P += B;
} else P += C;
}
return P;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Wrong Answer: wrong guess. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
3 |
Correct |
1 ms |
200 KB |
Output is correct |
4 |
Correct |
1 ms |
200 KB |
Output is correct |
5 |
Incorrect |
1 ms |
200 KB |
Wrong Answer: wrong guess. |
6 |
Halted |
0 ms |
0 KB |
- |