QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#46763 | #4670. How To Identify Self | Qingyu | AC ✓ | 3ms | 3732kb | C++23 | 857b | 2022-09-01 16:41:39 | 2022-09-01 16:42:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int query(string x) {
cout << "? " << x << endl;
int ans;
cin >> ans;
return ans;
}
int main() {
if (query("e4")) {
if (query("d5")) {
query("e4");
query("e2");
puts("! q");
}
else {
query("e2");
puts("! r");
}
}
else {
if (query("d3")) {
if (query("b5")) {
query("e2");
puts("! b");
}
else {
query("e2");
puts("! k");
}
}
else {
if (query("d4")) {
query("e2");
puts("! n");
}
else {
puts("! p");
}
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3504kb
input:
1 0 1
output:
? e4 ? d5 ? e2 ! r
result:
ok you are r, used 3 steps
Test #2:
score: 0
Accepted
time: 3ms
memory: 3672kb
input:
0 0 0
output:
? e4 ? d3 ? d4 ! p
result:
ok you are p, used 3 steps
Test #3:
score: 0
Accepted
time: 3ms
memory: 3732kb
input:
0 1 1 1
output:
? e4 ? d3 ? b5 ? e2 ! b
result:
ok you are b, used 4 steps
Test #4:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
0 0 1 1
output:
? e4 ? d3 ? d4 ? e2 ! n
result:
ok you are n, used 4 steps
Test #5:
score: 0
Accepted
time: 3ms
memory: 3616kb
input:
1 1 1 1
output:
? e4 ? d5 ? e4 ? e2 ! q
result:
ok you are q, used 4 steps
Test #6:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
0 1 0 1
output:
? e4 ? d3 ? b5 ? e2 ! k
result:
ok you are k, used 4 steps