QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#155331#7114. Best Interactive Playerucup-team1196#AC ✓2ms3540kbC++142.0kb2023-09-01 15:55:002023-09-01 15:55:01

Judging History

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

  • [2023-09-01 15:55:01]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3540kb
  • [2023-09-01 15:55:00]
  • 提交

answer

/*
 
_/      _/    _/      _/    _/      _/   _/_/_/_/_/     _/_/       _/      _/ 
 _/    _/     _/      _/     _/    _/        _/       _/    _/     _/      _/            
  _/  _/      _/      _/      _/  _/         _/      _/      _/    _/_/  _/_/         
   _/_/       _/_/_/_/_/        _/           _/      _/      _/    _/  _/  _/          
  _/  _/      _/      _/        _/           _/      _/      _/    _/      _/          
 _/    _/     _/      _/        _/           _/       _/    _/     _/      _/          
_/      _/    _/      _/        _/           _/         _/_/       _/      _/       
 
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define multi int _;cin>>_;while(_--)
#define debug(x) cerr << #x << " = " << (x) << endl;
#define int long long
#define pb push_back
#define eb emplace_back
ll gcd(ll a,ll b){ return b?gcd(b,a%b):a;}
mt19937 mrand(random_device{}());
int rnd(int x){ return mrand() % x; }
void test() {cerr << "\n";}
template<typename T, typename... Args> 
void test(T x, Args... args) {cerr << x << " ";test(args...);}
// const ll MOD = 998244353;
const ll MOD = 1e9+7;
int ksm(int x,int y){int ans=1;x%=MOD;while(y){if(y&1)ans=ans*x%MOD;x=x*x%MOD,y/=2;}return ans;}

const ll P1 = 999971, base1 = 101;
const ll P2 = 999973, base2 = 103;
const ll N = 200005;
//head


signed main()
{  
#ifdef localfreopen
    // freopen("1.in","r",stdin);
#endif
    fastio
    int l = 0, r = 1e9;
    while(l < r)
    {
        int mid = l + r + 1 >> 1;
        auto check = [&](int mid)
        {
            cout << "? " << mid << endl;
            int op;
            cin >> op;
            return op;
        };
        if(check(mid))
        {
            r = mid - 1;
        }else{
            l = mid;
        }
    }
    cout << "! " << l << endl;
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3436kb

input:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1

output:

? 500000000
? 250000000
? 125000000
? 62500000
? 31250000
? 15625000
? 7812500
? 3906250
? 1953125
? 976562
? 488281
? 244140
? 122070
? 61035
? 30517
? 15258
? 7629
? 3814
? 1907
? 953
? 476
? 238
? 119
? 59
? 29
? 14
? 7
? 3
? 5
? 4
! 3

result:

ok ok

Test #2:

score: 0
Accepted
time: 0ms
memory: 3428kb

input:

1
1
0
0
0
1
1
1
0
0
1
1
1
1
1
1
1
0
0
0
0
0
1
1
1
0
1
0
1
1

output:

? 500000000
? 250000000
? 125000000
? 187500000
? 218750000
? 234375000
? 226562500
? 222656250
? 220703125
? 221679687
? 222167968
? 221923827
? 221801757
? 221740722
? 221710204
? 221694945
? 221687316
? 221683501
? 221685408
? 221686362
? 221686839
? 221687077
? 221687196
? 221687136
? 221687106
...

result:

ok ok

Test #3:

score: 0
Accepted
time: 2ms
memory: 3424kb

input:

1
0
0
1
1
0
0
1
1
0
1
0
1
0
0
0
1
0
1
0
0
0
1
1
1
0
0
1
0
1

output:

? 500000000
? 250000000
? 375000000
? 437500000
? 406250000
? 390625000
? 398437500
? 402343750
? 400390625
? 399414062
? 399902343
? 399658202
? 399780272
? 399719237
? 399749754
? 399765013
? 399772642
? 399768827
? 399770734
? 399769780
? 399770257
? 399770495
? 399770614
? 399770554
? 399770524
...

result:

ok ok

Test #4:

score: 0
Accepted
time: 2ms
memory: 3376kb

input:

1
0
1
1
0
1
1
1
1
0
0
1
0
1
0
0
1
0
1
1
1
1
0
1
1
0
0
1
0
0

output:

? 500000000
? 250000000
? 375000000
? 312500000
? 281250000
? 296875000
? 289062500
? 285156250
? 283203125
? 282226562
? 282714843
? 282958984
? 282836913
? 282897948
? 282867430
? 282882689
? 282890318
? 282886503
? 282888410
? 282887456
? 282886979
? 282886741
? 282886622
? 282886681
? 282886651
...

result:

ok ok

Test #5:

score: 0
Accepted
time: 2ms
memory: 3428kb

input:

1
0
0
0
1
0
0
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
0
1
1
0
0
0
0
1

output:

? 500000000
? 250000000
? 375000000
? 437500000
? 468750000
? 453125000
? 460937500
? 464843750
? 462890625
? 461914062
? 461425781
? 461181640
? 461059570
? 460998535
? 460968017
? 460983276
? 460975646
? 460971831
? 460969924
? 460970877
? 460970400
? 460970162
? 460970043
? 460970102
? 460970072
...

result:

ok ok

Test #6:

score: 0
Accepted
time: 2ms
memory: 3432kb

input:

0
1
0
1
1
1
0
0
0
1
1
0
0
1
1
0
1
1
1
1
1
1
0
1
0
1
1
0
1
1

output:

? 500000000
? 750000000
? 625000000
? 687500000
? 656250000
? 640625000
? 632812500
? 636718750
? 638671875
? 639648437
? 639160156
? 638916015
? 639038085
? 639099120
? 639068602
? 639053343
? 639060972
? 639057157
? 639055250
? 639054296
? 639053819
? 639053581
? 639053462
? 639053521
? 639053491
...

result:

ok ok

Test #7:

score: 0
Accepted
time: 2ms
memory: 3444kb

input:

0
0
1
0
1
1
1
0
1
1
0
1
0
0
0
0
0
0
0
1
1
1
0
1
0
1
0
1
1
1

output:

? 500000000
? 750000000
? 875000000
? 812500000
? 843750000
? 828125000
? 820312500
? 816406250
? 818359375
? 817382812
? 816894531
? 817138671
? 817016601
? 817077636
? 817108153
? 817123412
? 817131041
? 817134856
? 817136763
? 817137717
? 817137240
? 817137001
? 817136882
? 817136941
? 817136911
...

result:

ok ok

Test #8:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

0
1
0
0
1
1
0
0
1
0
1
1
1
1
0
0
0
0
1
1
0
1
1
1
0
1
0
1
0
1

output:

? 500000000
? 750000000
? 625000000
? 687500000
? 718750000
? 703125000
? 695312500
? 699218750
? 701171875
? 700195312
? 700683593
? 700439452
? 700317382
? 700256347
? 700225829
? 700241088
? 700248717
? 700252532
? 700254439
? 700253485
? 700253008
? 700253246
? 700253127
? 700253067
? 700253037
...

result:

ok ok

Test #9:

score: 0
Accepted
time: 2ms
memory: 3512kb

input:

0
0
1
0
0
1
1
1
1
0
1
0
0
0
0
0
1
1
1
0
1
0
1
1
1
0
0
1
0
1

output:

? 500000000
? 750000000
? 875000000
? 812500000
? 843750000
? 859375000
? 851562500
? 847656250
? 845703125
? 844726562
? 845214843
? 844970702
? 845092772
? 845153807
? 845184325
? 845199584
? 845207213
? 845203398
? 845201491
? 845200537
? 845201014
? 845200775
? 845200894
? 845200834
? 845200804
...

result:

ok ok

Test #10:

score: 0
Accepted
time: 0ms
memory: 3400kb

input:

0
0
0
1
1
1
1
1
1
0
0
1
1
0
1
1
0
0
1
0
0
1
1
1
0
1
1
1
1

output:

? 500000000
? 750000000
? 875000000
? 937500000
? 906250000
? 890625000
? 882812500
? 878906250
? 876953125
? 875976562
? 876464843
? 876708984
? 876586913
? 876525878
? 876556395
? 876541136
? 876533507
? 876537321
? 876539228
? 876538274
? 876538751
? 876538989
? 876538870
? 876538810
? 876538780
...

result:

ok ok

Test #11:

score: 0
Accepted
time: 2ms
memory: 3532kb

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

output:

? 500000000
? 750000000
? 875000000
? 937500000
? 968750000
? 984375000
? 992187500
? 996093750
? 998046875
? 999023438
? 999511719
? 999755860
? 999877930
? 999938965
? 999969483
? 999984742
? 999992371
? 999996186
? 999998093
? 999999047
? 999999524
? 999999762
? 999999881
? 999999941
? 999999971
...

result:

ok ok

Test #12:

score: 0
Accepted
time: 2ms
memory: 3540kb

input:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1

output:

? 500000000
? 250000000
? 125000000
? 62500000
? 31250000
? 15625000
? 7812500
? 3906250
? 1953125
? 976562
? 488281
? 244140
? 122070
? 61035
? 30517
? 15258
? 7629
? 3814
? 1907
? 953
? 476
? 238
? 119
? 59
? 29
? 14
? 7
? 3
? 1
? 2
! 1

result:

ok ok