QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#46764#4670. How To Identify SelfQingyuWA 3ms3636kbC++23870b2022-09-01 16:43:112022-09-01 16:43:14

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-09-01 16:43:14]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3636kb
  • [2022-09-01 16:43:11]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int query(string x) {
    cout << "? " << x << endl;
    int ans;
    cin >> ans;
    return ans;
}
int main() {
	query("e2");
    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: 1ms
memory: 3568kb

input:

1
1
0
1

output:

? e2
? e4
? d5
? e2
! r

result:

ok you are r, used 4 steps

Test #2:

score: 0
Accepted
time: 2ms
memory: 3564kb

input:

0
0
0
0

output:

? e2
? e4
? d3
? d4
! p

result:

ok you are p, used 4 steps

Test #3:

score: -100
Wrong Answer
time: 3ms
memory: 3636kb

input:

1
0
1
1

output:

? e2
? e4
? d3
? b5
? e2

result:

wrong answer query limit exceeded