QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#141014 | #5156. Going in Circles | As3b_team_f_masr | WA | 37ms | 3772kb | C++14 | 1.5kb | 2023-08-17 06:46:03 | 2023-08-17 06:46:06 |
Judging History
answer
#include <bits/stdc++.h>
typedef long double ld;
typedef long long ll;
using namespace std;
int di[] = {1, 0, -1, 0, 0, 1, -1, 1};
int dj[] = {0, 1, 0, -1, -1, 0, 1, -1};
const ll oo = 1e18, MOD = 1e9 + 7;
const int N = 1e6 + 5, M = 30005;
//#define endl '\n'
vector<int>v;
int main()
{
srand(time(0));
int n;
for(int i=0;i<20000;i++) v.push_back(rand()%2);
vector<int>tmp;
int idx=0;
for(int i=0;i<100;i++)
{
cin>>n;
tmp.push_back(n);
if(n!=1) {cout<<"? flip"<<endl;cout.flush();cin>>n;}
cout<<"? right"<<endl;
cout.flush();
}
cin>>n;
if(tmp.back()==1&&n==1)
{
cout<<"? flip"<<endl;cout.flush();cin>>n;
for(int i=1;i<=100;i++)
{
cout<<"? left"<<endl;
cout.flush();
cin>>n;
if(n==0)
{
return !(cout<<"! "<<i);
}
}
}
tmp.clear();
cout<<"? right"<<endl;
cout.flush();
while(1){
cin>>n;
tmp.push_back(n);
if(n!=v[idx++]) {cout<<"? flip"<<endl;cout.flush();cin>>n;}
if(tmp.size()%2==0&&tmp.size()>=9){
bool no=0;
for(int i=tmp.size()/2,j=0;i<tmp.size();i++,j++){
if(tmp[i]!=v[j]){
no=1;
break;
}
}
if(!no) return !(cout<<"! "<<tmp.size()/2);
}
cout<<"? right"<<endl;
cout.flush();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 6ms
memory: 3688kb
input:
0 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 1 0 1 ...
output:
? flip ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? right ? right ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? right ? right ? right ? right ? right ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip...
result:
ok Queries used; 15178.
Test #2:
score: 0
Accepted
time: 14ms
memory: 3696kb
input:
1 0 1 1 1 1 0 1 1 1 0 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 ...
output:
? right ? flip ? right ? right ? right ? right ? flip ? right ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? flip ? ...
result:
ok Queries used; 14726.
Test #3:
score: 0
Accepted
time: 27ms
memory: 3708kb
input:
0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 0 1 1 1 1 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 ...
output:
? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? right ? flip ? right ? ri...
result:
ok Queries used; 15031.
Test #4:
score: 0
Accepted
time: 37ms
memory: 3684kb
input:
0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 1 0 1 0 ...
output:
? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? right ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? right ? right ? right ? right...
result:
ok Queries used; 12434.
Test #5:
score: 0
Accepted
time: 14ms
memory: 3624kb
input:
0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 1 0 1 0 ...
output:
? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? right ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? right ? right ? right ? right...
result:
ok Queries used; 12413.
Test #6:
score: 0
Accepted
time: 33ms
memory: 3628kb
input:
0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 1 0 1 0 ...
output:
? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? right ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? right ? right ? right ? right ? right...
result:
ok Queries used; 12400.
Test #7:
score: 0
Accepted
time: 10ms
memory: 3688kb
input:
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...
output:
? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ...
result:
ok Queries used; 15156.
Test #8:
score: 0
Accepted
time: 37ms
memory: 3772kb
input:
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...
output:
? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ...
result:
ok Queries used; 14715.
Test #9:
score: 0
Accepted
time: 31ms
memory: 3704kb
input:
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...
output:
? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ...
result:
ok Queries used; 15126.
Test #10:
score: -100
Wrong Answer
time: 0ms
memory: 3688kb
input:
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...
output:
? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ...
result:
wrong answer Wrong answer: incorrect guess 5 (ans: 4095). Queries used: 213