QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#785926 | #4670. How To Identify Self | ucup-team266# | AC ✓ | 1ms | 3632kb | C++14 | 982b | 2024-11-26 19:37:54 | 2024-11-26 19:37:55 |
Judging History
answer
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int ans;
cout << "? a2" << endl;
cin >> ans;
if(ans == 1){
cout << "? b3" << endl;
cin >> ans;
if(ans == 1){
cout << "? a2" << endl;
cout << "? e2" << endl;
cout << "! q" << endl;
} else {
cout << "? e2" << endl;
cout << "! r" << endl;
}
} else {
cout << "? d3" << endl;
cin >> ans;
if(ans == 1){
cout << "? a6" << endl;
cin >> ans;
if(ans == 1){
cout << "? e2" << endl;
cout << "! b" << endl;
} else {
cout << "? e2" << endl;
cout << "! k" << endl;
}
} else {
cout << "? c1" << endl;
cin >> ans;
if(ans == 1){
cout << "? e2" << endl;
cout << "! n" << endl;
} else {
cout << "! p" << endl;
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3620kb
input:
1 0 1
output:
? a2 ? b3 ? e2 ! r
result:
ok you are r, used 3 steps
Test #2:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
0 0 0
output:
? a2 ? d3 ? c1 ! p
result:
ok you are p, used 3 steps
Test #3:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
0 1 1 1
output:
? a2 ? d3 ? a6 ? e2 ! b
result:
ok you are b, used 4 steps
Test #4:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
0 0 1 1
output:
? a2 ? d3 ? c1 ? e2 ! n
result:
ok you are n, used 4 steps
Test #5:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
1 1 1 1
output:
? a2 ? b3 ? a2 ? e2 ! q
result:
ok you are q, used 4 steps
Test #6:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
0 1 0 1
output:
? a2 ? d3 ? a6 ? e2 ! k
result:
ok you are k, used 4 steps