QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#201687 | #5156. Going in Circles | S_Explosion# | WA | 15ms | 3704kb | C++20 | 1.1kb | 2023-10-05 16:07:33 | 2023-10-05 16:07:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
mt19937 rnd(1128);
const int lim=50;
int s;
string sta,cur;
int main(){
int i,j;
cin>>s;
for(i=1;i<=lim;i++){
if(s==1){
cout<<"? flip"<<endl;
cin>>s;
}
cout<<"? right"<<endl;
cin>>s;
}
if(s==0){
cout<<"? flip"<<endl;
cin>>s;
}
for(i=1;i<=lim;i++){
cout<<"? right"<<endl;
cin>>s;
if(s)
break;
}
cout<<"? flip"<<endl;
cin>>s;
for(j=1;j<=i;j++){
cout<<"? left"<<endl;
cin>>s;
}
if(s==0){
cout<<"! "<<i<<endl;
return 0;
}
for(i=1;i<=lim;i++){
if(rnd()%2==1){
cout<<"? flip"<<endl;
cin>>s;
}
sta+=s+'0';
cout<<"? right"<<endl;
cin>>s;
}
cur=sta;
for(i=1;;i++){
cur.erase(0,1);
cur+=s+'0';
if(cur==sta)
break;
cout<<"? right"<<endl;
cin>>s;
}
cout<<"! "<<i<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 13ms
memory: 3640kb
input:
0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 ...
output:
? right ? flip ? right ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? ri...
result:
ok Queries used; 5157.
Test #2:
score: 0
Accepted
time: 8ms
memory: 3704kb
input:
1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 1 0 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 1 0 0 1 0 1 0 0 0 1 1 ...
output:
? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? right ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? right ? flip ?...
result:
ok Queries used; 5007.
Test #3:
score: 0
Accepted
time: 13ms
memory: 3704kb
input:
0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 ...
output:
? right ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? right ? right ? flip ? right ? right ? right ? right ? flip ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? right ? right ? flip ? right ? right ? flip ? righ...
result:
ok Queries used; 5152.
Test #4:
score: 0
Accepted
time: 5ms
memory: 3640kb
input:
0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 ...
output:
? right ? right ? flip ? right ? right ? flip ? right ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? ...
result:
ok Queries used; 4255.
Test #5:
score: 0
Accepted
time: 9ms
memory: 3704kb
input:
0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 ...
output:
? right ? right ? flip ? right ? right ? flip ? right ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? ...
result:
ok Queries used; 4256.
Test #6:
score: 0
Accepted
time: 6ms
memory: 3576kb
input:
0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 ...
output:
? right ? right ? flip ? right ? right ? flip ? right ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? ...
result:
ok Queries used; 4257.
Test #7:
score: 0
Accepted
time: 15ms
memory: 3576kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? ri...
result:
ok Queries used; 5228.
Test #8:
score: 0
Accepted
time: 5ms
memory: 3644kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ...
output:
? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? ri...
result:
ok Queries used; 5076.
Test #9:
score: 0
Accepted
time: 3ms
memory: 3588kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? ri...
result:
ok Queries used; 5227.
Test #10:
score: -100
Wrong Answer
time: 1ms
memory: 3568kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? right ? ri...
result:
wrong answer Wrong answer: incorrect guess 51 (ans: 4095). Queries used: 153