QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#46763#4670. How To Identify SelfQingyuAC ✓3ms3732kbC++23857b2022-09-01 16:41:392022-09-01 16:42:32

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:42:32]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3732kb
  • [2022-09-01 16:41:39]
  • 提交

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