QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#141014#5156. Going in CirclesAs3b_team_f_masrWA 37ms3772kbC++141.5kb2023-08-17 06:46:032023-08-17 06:46:06

Judging History

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

  • [2023-08-17 06:46:06]
  • 评测
  • 测评结果:WA
  • 用时:37ms
  • 内存:3772kb
  • [2023-08-17 06:46:03]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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