QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#65161 | #4670. How To Identify Self | T3alaadl3k2olyehymn3k# | AC ✓ | 4ms | 3380kb | C++20 | 1.0kb | 2022-11-27 21:16:10 | 2022-11-27 21:16:14 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
bool query(string s) {
cout << "? " << s << endl;
bool f;
cin >> f;
return f == 1;
}
void answer(char s) {
cout << "! " << s << endl;
exit(0);
}
signed main() {
// initally it's a pawn
if (query("d3"))//bishop,king,queen
{
if (query("a3"))//queen
{
query("a2");
query("e2");
answer('q');
} else { //bishop , king is in e2
if (query("a6")) { // bishop
query("e2");
answer('b');
} else { // king
query("e2");
answer('k');
}
}
} else //pawn, knight,rook
{
if (query("g3")) { // knight
query("e2");
answer('n');
} else {
if (query("e8"))//rook
{
query("e2");
answer('r');
} else
answer('p');
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3320kb
input:
0 0 1 1
output:
? d3 ? g3 ? e8 ? e2 ! r
result:
ok you are r, used 4 steps
Test #2:
score: 0
Accepted
time: 2ms
memory: 3324kb
input:
0 0 0
output:
? d3 ? g3 ? e8 ! p
result:
ok you are p, used 3 steps
Test #3:
score: 0
Accepted
time: 2ms
memory: 3292kb
input:
1 0 1 1
output:
? d3 ? a3 ? a6 ? e2 ! b
result:
ok you are b, used 4 steps
Test #4:
score: 0
Accepted
time: 1ms
memory: 3264kb
input:
0 1 1
output:
? d3 ? g3 ? e2 ! n
result:
ok you are n, used 3 steps
Test #5:
score: 0
Accepted
time: 4ms
memory: 3380kb
input:
1 1 1 1
output:
? d3 ? a3 ? a2 ? e2 ! q
result:
ok you are q, used 4 steps
Test #6:
score: 0
Accepted
time: 4ms
memory: 3280kb
input:
1 0 0 1
output:
? d3 ? a3 ? a6 ? e2 ! k
result:
ok you are k, used 4 steps