QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#199348#5156. Going in CircleskevinshanWA 1ms3388kbC++202.2kb2023-10-04 09:41:482023-10-04 09:41:48

Judging History

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

  • [2023-10-04 09:41:48]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3388kb
  • [2023-10-04 09:41:48]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define ps push
#define in insert
#define f first
#define s second
#define nl cout<<"\n"
#define ca(v) for(auto i:v) cout<<i<<" ";
#define cbit(x) __builtin_popcount(x)
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a*b/gcd(a, b))
int xm[4] = {-1, 1, 0, 0};
int ym[4] = {0, 0, -1, 1};
const int MOD = 1e9 + 7;
const int MAXN = 5e5 + 5;
const ll POW = 9973;

void runsmall(){
    for(int k=0; k<50; k++){
        int x; cin>>x;
        if(x) { cout<<"? flip"<<endl; int y; cin>>y; }
        cout<<"? right"<<endl;
    }
    int ty; cin>>ty;
    cout<<"? flip"<<endl;
    cin>>ty;
    for(int i=1; i<=35; i++){
        cout<<"? left"<<endl;
        int x; cin>>x;
        if(x) {
            cout<<"! "<<i<<endl;
            return;
        }
    }
}

int main()
{
    // ios_base::sync_with_stdio(0); cin.tie(0);
    ll mask = 354768438787341231;
    // cout<<mask;
    for(int k=0; k<30; k++){
        int x; cin>>x;
        if(x) {
            cout<<"? flip"<<endl;
            int y; cin>>y;
        }
        cout<<"? right"<<endl;
    }
    int txx; cin>>txx;
    cout<<"? left"<<endl;
    for(int k=0; k<30; k++){
        int x; cin>>x;
        if(x){
            cout<<"EEEE";
            cout<<"? left"<<endl;
            runsmall(); 
            return 0;
        }
        if(mask & (ll)(1<<k)){
            cout<<"? flip"<<endl;
            int ty; cin>>ty;
        }
        cout<<"? left"<<endl;
    }

    int tmpkt; cin>>tmpkt;
    cout<<"! 3"<<endl;
    return 0;
    cout<<"? left"<<endl;
    cin>> tmpkt;
    cout<<"? left"<<endl;
    
    ll cur = 0;
    int a = 0;
    int firstend = 0;
    int lastend = 0;
    while(1){
        int x; cin>>x;
        if(cur & (1<<29)) cur -= (1<<29);
        cur *= 2;
        cur += x;
        if(a >= 29){
            if(cur == mask){
                if(firstend){
                    cout<<"! "<<a - firstend<<endl;
                    return 0;
                }
                else firstend = a;
            }
        }
        a += 1;
        cout<<"? right"<<endl;
    }
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3388kb

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

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:

wrong answer Wrong answer: incorrect guess 3 (ans: 5000). Queries used: 99