# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
962200 |
2024-04-13T08:51:02 Z |
anango |
Combo (IOI18_combo) |
C++17 |
|
1 ms |
344 KB |
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N) {
string p="";
int n=press("AB");
char first;
if (n>=1) {
int m=press("A");
if (m==1) {
first='A';
}
else {
first='B';
}
}
else {
int m=press("X");
if (m==1) {
first='X';
}
else {
first='Y';
}
}
string cur(1,first);
set<string> others={"A", "B","X","Y"};
vector<string> v;
others.erase(cur);
for (auto i:others) {
v.push_back(i);
}
for (int i=1; i<N-1; i++) {
string guesseq="";
for (int j=0; j<3; j++) {
guesseq+=cur+v[0]+v[j];
}
guesseq+=cur+v[1];
int ans=press(guesseq);
if (ans==i) {
cur+=v[2];
}
else if (ans==i+1) {
cur+=v[1];
}
else {
assert(ans==i+2);
cur+=v[0];
}
//cout <<i << " " << cur.size() << endl;
}
string cur2 = cur;
cur2.push_back('A');
cur2+=cur;
cur2.push_back('B');
int ans = press(cur);
string cur3 = cur;
cur3.push_back('A');
cur3+=cur;
cur3.push_back('X');
int ans2 = press(cur3);
int b1=ans!=N;
int b2=ans2!=N;
cur.push_back("ABXY"[2*b1+b2]);
return cur;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Wrong Answer: wrong guess. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong Answer: wrong guess. |
2 |
Halted |
0 ms |
0 KB |
- |