QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#208025#5156. Going in CirclesMinhhoWA 17ms3624kbC++201.4kb2023-10-09 03:41:502023-10-09 03:41:51

Judging History

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

  • [2023-10-09 03:41:51]
  • 评测
  • 测评结果:WA
  • 用时:17ms
  • 内存:3624kb
  • [2023-10-09 03:41:50]
  • 提交

answer

#define taskname "G"
#include <bits/stdc++.h>
#define int long long

using namespace std;
const string l = "? left", r = "? right", f = "? flip";
int x;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

void checksmall()
{
    for (int i=1; i<=50; i++)
    {
        cout<<l<<endl;
        cin>>x;
        if (x) cout<<f<<endl, cin>>x;
    }
    cout<<f<<endl;
    cin>>x;
    for (int i=1; i<=50; i++)
    {
        cout<<r<<endl;
        cin>>x;
        if (x)
        {
            cout<<"! "<<i;
            exit(0);
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    cin>>x;
    if (x) cout<<f<<endl, cin>>x;
    checksmall();
    int rnd = 0, rrnd = 0;
    for (int i=0; i<=29; i++)
    {
        int x = rng() & 1;
        rnd += x * (1ll<<i);
        if (i < 29) rrnd += x * (1ll<<i);
    }
//    cout<<rnd<<"\n";
//    cout<<rnd % (1ll<<29)<<" "<<rrnd<<"\n";
    for (int i=0; i<30; i++)
    {
        cout<<l<<endl;
        cin>>x;
        if (x != (rnd >> (29-i)) & 1) cout<<f<<endl, cin>>x;
    }
    int cur = rnd, cnt = 0;
    for (int i=1; i<=1e5; i++)
    {
        cnt++;
        cout<<l<<endl;
        cin>>x;
        cur %= (1ll<<29);
        cur <<= 1;
        cur |= x;
        if (cur == rnd) return cout<<"! "<<cnt, 0;
    }
}

详细

Test #1:

score: 0
Wrong Answer
time: 17ms
memory: 3624kb

input:

0
1
0
0
1
0
0
1
0
0
1
0
1
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
1
0
0
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
0
1
0
0
1
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
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
...

output:

? left
? flip
? left
? left
? flip
? left
? left
? flip
? left
? left
? flip
? left
? flip
? left
? left
? left
? left
? left
? left
? left
? left
? flip
? left
? left
? left
? flip
? left
? left
? flip
? left
? left
? flip
? left
? left
? flip
? left
? left
? flip
? left
? flip
? left
? flip
? left...

result:

wrong answer Wrong answer: used too many queries. Queries used: 26001 (10501 too many, terminated)