QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#397743#5134. Jagged Skylineucup-team1001#AC ✓20ms3924kbC++231.6kb2024-04-24 16:31:182024-04-24 16:31:19

Judging History

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

  • [2024-04-24 16:31:19]
  • 评测
  • 测评结果:AC
  • 用时:20ms
  • 内存:3924kb
  • [2024-04-24 16:31:18]
  • 提交

answer

/*

Author: Haze

2024/4/24

*/

#include <bits/stdc++.h>

#include <random>

#define irep(i, l, r) for(int i = (l); i <= (r); ++ i)
#define drep(i, r, l) for(int i = (r); i >= (l); -- i)
#define IOS ios::sync_with_stdio(false), cin.tie(nullptr);
using namespace std;
typedef long long ll;

inline ll read() {
    ll s = 0;
    bool fl = false;
    char ch = (char) getchar();
    while (!isdigit(ch)) {
        if (ch == '-')fl = true;
        ch = (char) getchar();
    }
    while (isdigit(ch)) {
        s = s * 10 + (ch ^ 48);
        ch = (char) getchar();
    }
    return fl ? -s : s;
}

const int mod = 1000000000 + 7;
const int itinf = 1000000999;
const ll llinf = 2e18;
const int N = 500099;
ll n, H;
int query(ll i, ll h){
    if(h > H)return 0;
    cout << "? " << i << ' ' << h << endl;
    string S;
    cin >> S;
    if(S == "sky")return 0;
    return 1;
}
void solve() {

    cin >> n >> H;
    vector<ll>ord(n);
    irep(i, 0, n - 1){
        ord[i] = i + 1;
    }
    shuffle(ord.begin(), ord.end(), std::mt19937(std::random_device()()));
    ll tp = 0, ans = 0;
    irep(i, 0, n - 1){
        ll idx = ord[i];
        if(query(idx, ans + 1) == 0)continue;
        ll l = ans + 1, r = H;
        while(l < r){
            ll mid = (l + r + 1) >> 1;
            if(query(idx, mid))l = mid;
            else r = mid - 1;
        }
        ans = l, tp = idx;
    }
    if(tp == 0)tp = 1;
    cout << "! " << tp << ' ' << ans << endl;
}

int main() {
    // IOS
    int T = 1;
    while (T--) {
        solve();
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3572kb

input:

1 1
sky

output:

? 1 1
! 1 0

result:

ok Used 1 queries

Test #2:

score: 0
Accepted
time: 1ms
memory: 3496kb

input:

1 1
building

output:

? 1 1
! 1 1

result:

ok Used 1 queries

Test #3:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

2 1
sky
sky

output:

? 2 1
? 1 1
! 1 0

result:

ok Used 2 queries

Test #4:

score: 0
Accepted
time: 1ms
memory: 3856kb

input:

2 1
building

output:

? 2 1
! 2 1

result:

ok Used 1 queries

Test #5:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

2 1000000000000000000
sky
sky

output:

? 1 1
? 2 1
! 1 0

result:

ok Used 2 queries

Test #6:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

2 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky

output:

? 1 1
? 1 500000000000000001
? 1 250000000000000001
? 1 125000000000000001
? 1 62500000000000001
? 1 31250000000000001
? 1 15625000000000001
? 1 7812500000000001
? 1 3906250000000001
? 1 1953125000000001
? 1 976562500000001
? 1 488281250000001
? 1 244140625000001
? 1 122070312500001
? 1 610351562500...

result:

ok Used 61 queries

Test #7:

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

input:

3 3
building
sky
sky
sky

output:

? 2 1
? 2 2
? 1 2
? 3 2
! 2 1

result:

ok Used 4 queries

Test #8:

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

input:

5 5
building
building
building
building

output:

? 2 1
? 2 3
? 2 4
? 2 5
! 2 5

result:

ok Used 4 queries

Test #9:

score: 0
Accepted
time: 1ms
memory: 3608kb

input:

8 4
building
sky
building
sky
sky
sky
building
sky
sky
sky
sky

output:

? 1 1
? 1 3
? 1 2
? 7 3
? 8 3
? 4 3
? 6 3
? 6 4
? 2 4
? 3 4
? 5 4
! 6 3

result:

ok Used 11 queries

Test #10:

score: 0
Accepted
time: 1ms
memory: 3608kb

input:

10 100
building
sky
building
sky
sky
sky
sky
building
building
sky
sky
building
building
building
building
sky
sky
sky
sky
sky
sky
sky
sky

output:

? 9 1
? 9 51
? 9 26
? 9 38
? 9 32
? 9 29
? 9 27
? 8 27
? 8 64
? 8 82
? 8 73
? 8 68
? 8 70
? 8 71
? 8 72
? 2 73
? 5 73
? 1 73
? 3 73
? 6 73
? 4 73
? 7 73
? 10 73
! 8 72

result:

ok Used 23 queries

Test #11:

score: 0
Accepted
time: 1ms
memory: 3624kb

input:

100 1000
building
building
sky
sky
sky
sky
building
sky
sky
building
building
sky
sky
building
building
sky
sky
sky
sky
building
building
building
sky
sky
sky
sky
building
sky
building
sky
sky
building
building
building
building
building
sky
sky
sky
sky
building
building
building
sky
sky
sky
sky
sky...

output:

? 4 1
? 4 501
? 4 751
? 4 626
? 4 563
? 4 532
? 4 516
? 4 524
? 4 520
? 4 518
? 4 519
? 78 520
? 14 520
? 12 520
? 12 760
? 12 880
? 12 820
? 12 790
? 12 775
? 12 767
? 12 771
? 12 773
? 12 774
? 42 774
? 93 774
? 69 774
? 45 774
? 45 887
? 45 830
? 45 858
? 45 844
? 45 837
? 45 840
? 45 842
? 45 84...

result:

ok Used 165 queries

Test #12:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

100 10
building
sky
sky
building
building
building
building
building

output:

? 99 1
? 99 6
? 99 3
? 99 2
? 33 3
? 33 7
? 33 9
? 33 10
! 33 10

result:

ok Used 8 queries

Test #13:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

1 98
building
building
building
sky
building
sky
sky

output:

? 1 1
? 1 50
? 1 74
? 1 86
? 1 80
? 1 83
? 1 81
! 1 80

result:

ok Used 7 queries

Test #14:

score: 0
Accepted
time: 6ms
memory: 3616kb

input:

899 2794
building
sky
sky
sky
building
building
building
building
sky
building
sky
building
building
building
building
sky
building
sky
building
sky
building
building
sky
building
sky
sky
building
building
building
sky
sky
sky
sky
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
bu...

output:

? 540 1
? 540 1398
? 540 699
? 540 350
? 540 175
? 540 262
? 540 306
? 540 328
? 540 339
? 540 333
? 540 336
? 540 334
? 540 335
? 776 336
? 776 1565
? 776 2180
? 776 1872
? 776 2026
? 776 1949
? 776 1987
? 776 1968
? 776 1977
? 776 1982
? 776 1979
? 776 1980
? 223 1980
? 585 1980
? 585 2387
? 585 2...

result:

ok Used 957 queries

Test #15:

score: 0
Accepted
time: 1ms
memory: 3660kb

input:

6370 86
building
sky
sky
sky
building
sky
building
building
sky
building
building
building
building
sky
building
building
sky
sky
building
sky
sky
building
building
sky
sky
sky
sky
building
sky
building
sky
building
building
building
building

output:

? 724 1
? 724 44
? 724 22
? 724 11
? 724 6
? 724 8
? 724 7
? 1530 8
? 1530 47
? 1530 27
? 1530 37
? 1530 42
? 1530 44
? 1530 45
? 4730 45
? 4730 66
? 4730 76
? 4730 71
? 4730 68
? 4730 69
? 5810 69
? 3316 69
? 3316 78
? 3316 82
? 3316 80
? 3316 79
? 4097 79
? 1222 79
? 1222 83
? 1222 81
? 1222 82
? ...

result:

ok Used 35 queries

Test #16:

score: 0
Accepted
time: 1ms
memory: 3524kb

input:

3647 2089
building
sky
building
building
sky
building
sky
building
building
building
building
building
sky
building
sky
sky
sky
building
sky
sky
sky
building
building
sky
building
building
building
building
building
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sk...

output:

? 3500 1
? 3500 1045
? 3500 523
? 3500 784
? 3500 914
? 3500 849
? 3500 881
? 3500 865
? 3500 873
? 3500 877
? 3500 879
? 3500 880
? 3041 881
? 3037 881
? 3037 1485
? 3037 1183
? 3037 1032
? 3037 956
? 3037 994
? 3037 975
? 3037 965
? 3037 960
? 3037 962
? 3037 963
? 3273 963
? 3273 1526
? 3273 1808...

result:

ok Used 103 queries

Test #17:

score: 0
Accepted
time: 7ms
memory: 3592kb

input:

3813 63935448
building
building
building
building
sky
sky
sky
building
building
building
building
sky
building
building
sky
building
sky
sky
sky
sky
sky
building
sky
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
sky
building
sky
sky
sky
sky
sky
building
sky
sky...

output:

? 1331 1
? 1331 31967725
? 1331 47951587
? 1331 55943518
? 1331 59939483
? 1331 57941500
? 1331 56942509
? 1331 56443013
? 1331 56692761
? 1331 56817635
? 1331 56880072
? 1331 56911290
? 1331 56895681
? 1331 56903485
? 1331 56907387
? 1331 56905436
? 1331 56906411
? 1331 56905923
? 1331 56905679
? 1...

result:

ok Used 3931 queries

Test #18:

score: 0
Accepted
time: 10ms
memory: 3836kb

input:

3689 531350850216
building
building
building
building
building
building
building
building
sky
sky
sky
building
building
building
building
sky
building
sky
building
sky
building
sky
sky
sky
sky
sky
sky
building
sky
building
sky
sky
sky
building
sky
building
sky
building
building
sky
sky
sky
sky
sky
s...

output:

? 885 1
? 885 265675425109
? 885 398513137663
? 885 464931993940
? 885 498141422078
? 885 514746136147
? 885 523048493182
? 885 527199671699
? 885 529275260958
? 885 528237466328
? 885 527718569013
? 885 527459120356
? 885 527588844684
? 885 527653706848
? 885 527686137930
? 885 527702353471
? 885 5...

result:

ok Used 3849 queries

Test #19:

score: 0
Accepted
time: 15ms
memory: 3572kb

input:

10000 1000000000000000000
building
building
building
building
sky
sky
building
sky
building
building
building
building
sky
building
building
sky
building
sky
building
building
building
building
building
building
sky
sky
sky
sky
building
sky
building
building
sky
building
building
building
building
s...

output:

? 6393 1
? 6393 500000000000000001
? 6393 750000000000000001
? 6393 875000000000000001
? 6393 937500000000000001
? 6393 906250000000000001
? 6393 890625000000000001
? 6393 898437500000000001
? 6393 894531250000000001
? 6393 896484375000000001
? 6393 897460937500000001
? 6393 897949218750000001
? 639...

result:

ok Used 10582 queries

Test #20:

score: 0
Accepted
time: 7ms
memory: 3624kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
sky
building
sky
building
sky
building
building
sky
...

output:

? 3216 1
? 3216 500000000000000001
? 3216 250000000000000001
? 3216 125000000000000001
? 3216 62500000000000001
? 3216 31250000000000001
? 3216 15625000000000001
? 3216 7812500000000001
? 3216 3906250000000001
? 3216 1953125000000001
? 3216 976562500000001
? 3216 488281250000001
? 3216 2441406250000...

result:

ok Used 10180 queries

Test #21:

score: 0
Accepted
time: 20ms
memory: 3852kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
s...

output:

? 9345 1
? 9345 500000000000000001
? 9345 250000000000000001
? 9345 125000000000000001
? 9345 62500000000000001
? 9345 31250000000000001
? 9345 15625000000000001
? 9345 7812500000000001
? 9345 3906250000000001
? 9345 1953125000000001
? 9345 976562500000001
? 9345 488281250000001
? 9345 2441406250000...

result:

ok Used 10059 queries

Test #22:

score: 0
Accepted
time: 11ms
memory: 3700kb

input:

10000 1000000000000000000
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sk...

output:

? 612 1
? 9371 1
? 6719 1
? 2906 1
? 6966 1
? 665 1
? 8693 1
? 3460 1
? 9810 1
? 8902 1
? 5193 1
? 9939 1
? 6419 1
? 753 1
? 4595 1
? 4529 1
? 7853 1
? 1430 1
? 6682 1
? 2731 1
? 5421 1
? 4100 1
? 1607 1
? 1977 1
? 679 1
? 208 1
? 2989 1
? 1080 1
? 9277 1
? 38 1
? 6452 1
? 3718 1
? 3696 1
? 1622 1
?...

result:

ok Used 10059 queries

Test #23:

score: 0
Accepted
time: 18ms
memory: 3700kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky...

output:

? 6438 1
? 6438 500000000000000001
? 6438 250000000000000001
? 6438 125000000000000001
? 6438 62500000000000001
? 6438 31250000000000001
? 6438 15625000000000001
? 6438 7812500000000001
? 6438 3906250000000001
? 6438 1953125000000001
? 6438 976562500000001
? 6438 488281250000001
? 6438 2441406250000...

result:

ok Used 10059 queries

Test #24:

score: 0
Accepted
time: 9ms
memory: 3688kb

input:

10000 1000000000000000000
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
buil...

output:

? 3999 1
? 3999 500000000000000001
? 3999 750000000000000001
? 3999 875000000000000001
? 3999 937500000000000001
? 3999 968750000000000001
? 3999 984375000000000001
? 3999 992187500000000001
? 3999 996093750000000001
? 3999 998046875000000001
? 3999 999023437500000001
? 3999 999511718750000001
? 399...

result:

ok Used 6441 queries

Test #25:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

8 4
building
sky
sky
building
sky
building
sky
building

output:

? 1 1
? 1 3
? 1 2
? 3 2
? 3 3
? 4 3
? 4 4
? 6 4
! 6 4

result:

ok Used 8 queries

Test #26:

score: 0
Accepted
time: 1ms
memory: 3856kb

input:

8 4
building
sky
sky
building
building
building

output:

? 8 1
? 8 3
? 8 2
? 3 2
? 3 3
? 3 4
! 3 4

result:

ok Used 6 queries

Test #27:

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

input:

3 3
sky
building
building
building

output:

? 1 1
? 3 1
? 3 2
? 3 3
! 3 3

result:

ok Used 4 queries

Test #28:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

3 3
sky
building
building
building

output:

? 3 1
? 1 1
? 1 2
? 1 3
! 1 3

result:

ok Used 4 queries

Test #29:

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

input:

5 5
sky
building
building
building
building

output:

? 4 1
? 1 1
? 1 3
? 1 4
? 1 5
! 1 5

result:

ok Used 5 queries

Test #30:

score: 0
Accepted
time: 1ms
memory: 3500kb

input:

8 4
building
building
sky
sky
sky
sky
sky
building

output:

? 6 1
? 6 3
? 6 4
? 3 4
? 2 4
? 4 4
? 8 4
? 5 4
! 5 4

result:

ok Used 8 queries

Test #31:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

3 3
building
building
sky
building

output:

? 2 1
? 2 2
? 2 3
? 3 3
! 3 3

result:

ok Used 4 queries

Test #32:

score: 0
Accepted
time: 18ms
memory: 3892kb

input:

10000 1000000000000000000
building
sky
building
building
building
building
sky
building
building
building
sky
sky
building
sky
sky
building
sky
sky
sky
sky
building
sky
sky
building
building
sky
building
sky
sky
building
sky
building
building
sky
sky
sky
building
building
building
sky
building
build...

output:

? 4791 1
? 4791 500000000000000001
? 4791 250000000000000001
? 4791 375000000000000001
? 4791 437500000000000001
? 4791 468750000000000001
? 4791 484375000000000001
? 4791 476562500000000001
? 4791 480468750000000001
? 4791 482421875000000001
? 4791 483398437500000001
? 4791 482910156250000001
? 479...

result:

ok Used 10543 queries

Test #33:

score: 0
Accepted
time: 13ms
memory: 3624kb

input:

10000 1000000000000000000
building
building
building
sky
sky
sky
building
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
building
building
building
building
sky
building
sky
building
building
building
sky
sky
building
sky
building
building
building
building
sky
b...

output:

? 2279 1
? 2279 500000000000000001
? 2279 750000000000000001
? 2279 875000000000000001
? 2279 812500000000000001
? 2279 781250000000000001
? 2279 765625000000000001
? 2279 773437500000000001
? 2279 769531250000000001
? 2279 771484375000000001
? 2279 772460937500000001
? 2279 771972656250000001
? 227...

result:

ok Used 10367 queries

Test #34:

score: 0
Accepted
time: 14ms
memory: 3688kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
building
building
building
building
sky
building
building
sky
sky
sky
sky
sky
sky
b...

output:

? 2290 1
? 2290 500000000000000001
? 2290 250000000000000001
? 2290 125000000000000001
? 2290 62500000000000001
? 2290 31250000000000001
? 2290 15625000000000001
? 2290 7812500000000001
? 2290 3906250000000001
? 2290 1953125000000001
? 2290 976562500000001
? 2290 488281250000001
? 2290 2441406250000...

result:

ok Used 10540 queries

Test #35:

score: 0
Accepted
time: 10ms
memory: 3680kb

input:

10000 1000000000000000000
building
sky
sky
sky
building
sky
sky
sky
sky
sky
sky
building
sky
building
sky
building
sky
sky
sky
building
sky
building
sky
sky
sky
building
sky
building
building
building
building
sky
sky
building
building
building
building
sky
building
sky
sky
building
sky
building
sky...

output:

? 3691 1
? 3691 500000000000000001
? 3691 250000000000000001
? 3691 125000000000000001
? 3691 62500000000000001
? 3691 93750000000000001
? 3691 78125000000000001
? 3691 70312500000000001
? 3691 66406250000000001
? 3691 64453125000000001
? 3691 63476562500000001
? 3691 62988281250000001
? 3691 632324...

result:

ok Used 10510 queries

Test #36:

score: 0
Accepted
time: 18ms
memory: 3624kb

input:

10000 1000000000000000000
building
building
building
building
sky
building
building
building
sky
building
building
building
building
building
building
building
sky
building
sky
building
building
building
sky
sky
sky
building
building
building
sky
sky
building
building
sky
building
sky
sky
building
b...

output:

? 2992 1
? 2992 500000000000000001
? 2992 750000000000000001
? 2992 875000000000000001
? 2992 937500000000000001
? 2992 906250000000000001
? 2992 921875000000000001
? 2992 929687500000000001
? 2992 933593750000000001
? 2992 931640625000000001
? 2992 932617187500000001
? 2992 933105468750000001
? 299...

result:

ok Used 10537 queries

Test #37:

score: 0
Accepted
time: 18ms
memory: 3620kb

input:

10000 1000000000000000000
building
building
sky
sky
building
building
building
building
building
building
sky
sky
sky
sky
sky
sky
sky
building
sky
building
sky
sky
building
building
sky
sky
building
sky
sky
sky
building
sky
sky
sky
sky
building
building
building
building
building
building
sky
buildi...

output:

? 6638 1
? 6638 500000000000000001
? 6638 750000000000000001
? 6638 625000000000000001
? 6638 562500000000000001
? 6638 593750000000000001
? 6638 609375000000000001
? 6638 617187500000000001
? 6638 621093750000000001
? 6638 623046875000000001
? 6638 624023437500000001
? 6638 623535156250000001
? 663...

result:

ok Used 10602 queries

Test #38:

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

input:

10000 1000000000000000000
building
sky
sky
sky
building
building
building
sky
building
building
sky
sky
sky
building
sky
building
sky
sky
sky
building
sky
building
sky
building
sky
sky
sky
sky
building
building
sky
sky
sky
building
building
building
sky
sky
building
sky
building
building
building
sk...

output:

? 1085 1
? 1085 500000000000000001
? 1085 250000000000000001
? 1085 125000000000000001
? 1085 62500000000000001
? 1085 93750000000000001
? 1085 109375000000000001
? 1085 117187500000000001
? 1085 113281250000000001
? 1085 115234375000000001
? 1085 116210937500000001
? 1085 115722656250000001
? 1085 ...

result:

ok Used 10553 queries

Test #39:

score: 0
Accepted
time: 5ms
memory: 3920kb

input:

10000 1000000000000000000
building
sky
sky
building
building
sky
sky
sky
sky
building
building
sky
building
sky
building
sky
building
building
building
building
building
building
building
sky
building
building
sky
building
sky
sky
sky
building
building
sky
building
building
building
building
sky
sky...

output:

? 6749 1
? 6749 500000000000000001
? 6749 250000000000000001
? 6749 125000000000000001
? 6749 187500000000000001
? 6749 218750000000000001
? 6749 203125000000000001
? 6749 195312500000000001
? 6749 191406250000000001
? 6749 189453125000000001
? 6749 190429687500000001
? 6749 190917968750000001
? 674...

result:

ok Used 10599 queries

Test #40:

score: 0
Accepted
time: 7ms
memory: 3692kb

input:

10000 1000000000000000000
building
sky
sky
sky
building
building
building
sky
building
sky
building
sky
building
building
sky
building
building
sky
sky
building
building
building
building
sky
building
building
sky
sky
sky
sky
building
building
sky
building
sky
building
sky
building
building
building...

output:

? 8091 1
? 8091 500000000000000001
? 8091 250000000000000001
? 8091 125000000000000001
? 8091 62500000000000001
? 8091 93750000000000001
? 8091 109375000000000001
? 8091 117187500000000001
? 8091 113281250000000001
? 8091 115234375000000001
? 8091 114257812500000001
? 8091 114746093750000001
? 8091 ...

result:

ok Used 10776 queries

Test #41:

score: 0
Accepted
time: 12ms
memory: 3692kb

input:

10000 1000000000000000000
building
sky
building
building
building
sky
building
sky
building
building
building
sky
building
building
building
sky
sky
sky
sky
building
building
building
sky
sky
sky
building
building
sky
sky
building
sky
sky
building
building
sky
sky
building
building
building
building...

output:

? 3515 1
? 3515 500000000000000001
? 3515 250000000000000001
? 3515 375000000000000001
? 3515 437500000000000001
? 3515 468750000000000001
? 3515 453125000000000001
? 3515 460937500000000001
? 3515 457031250000000001
? 3515 458984375000000001
? 3515 459960937500000001
? 3515 460449218750000001
? 351...

result:

ok Used 10636 queries

Test #42:

score: 0
Accepted
time: 14ms
memory: 3688kb

input:

10000 1000000000000000000
building
building
building
building
building
building
building
sky
sky
building
sky
sky
building
sky
sky
building
sky
building
building
sky
sky
sky
sky
building
building
building
building
building
building
building
sky
sky
sky
sky
sky
building
sky
sky
sky
building
sky
sky
b...

output:

? 127 1
? 127 500000000000000001
? 127 750000000000000001
? 127 875000000000000001
? 127 937500000000000001
? 127 968750000000000001
? 127 984375000000000001
? 127 992187500000000001
? 127 988281250000000001
? 127 986328125000000001
? 127 987304687500000001
? 127 986816406250000001
? 127 98657226562...

result:

ok Used 10415 queries

Test #43:

score: 0
Accepted
time: 10ms
memory: 3576kb

input:

10000 1000000000000000000
building
sky
sky
building
building
building
building
sky
sky
building
sky
sky
sky
sky
sky
building
building
sky
sky
building
building
sky
sky
sky
sky
sky
building
sky
sky
sky
sky
building
sky
building
sky
building
sky
building
sky
sky
sky
building
sky
sky
building
building
...

output:

? 302 1
? 302 500000000000000001
? 302 250000000000000001
? 302 125000000000000001
? 302 187500000000000001
? 302 218750000000000001
? 302 234375000000000001
? 302 242187500000000001
? 302 238281250000000001
? 302 236328125000000001
? 302 237304687500000001
? 302 236816406250000001
? 302 23657226562...

result:

ok Used 10589 queries

Test #44:

score: 0
Accepted
time: 3ms
memory: 3624kb

input:

10000 1000000000000000000
building
building
sky
building
sky
sky
building
sky
building
sky
building
building
sky
sky
building
building
building
building
building
building
building
sky
sky
sky
sky
sky
building
building
sky
sky
sky
building
building
sky
sky
building
building
sky
building
building
sky
...

output:

? 5066 1
? 5066 500000000000000001
? 5066 750000000000000001
? 5066 625000000000000001
? 5066 687500000000000001
? 5066 656250000000000001
? 5066 640625000000000001
? 5066 648437500000000001
? 5066 644531250000000001
? 5066 646484375000000001
? 5066 645507812500000001
? 5066 645996093750000001
? 506...

result:

ok Used 10697 queries

Test #45:

score: 0
Accepted
time: 9ms
memory: 3852kb

input:

10000 1000000000000000000
building
building
sky
building
building
sky
building
building
building
building
sky
sky
sky
building
sky
sky
sky
sky
sky
sky
building
building
sky
building
sky
building
sky
building
sky
building
building
building
building
sky
sky
sky
building
sky
building
building
sky
sky
s...

output:

? 3279 1
? 3279 500000000000000001
? 3279 750000000000000001
? 3279 625000000000000001
? 3279 687500000000000001
? 3279 718750000000000001
? 3279 703125000000000001
? 3279 710937500000000001
? 3279 714843750000000001
? 3279 716796875000000001
? 3279 717773437500000001
? 3279 717285156250000001
? 327...

result:

ok Used 10439 queries

Test #46:

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

input:

10000 1000000000000000000
building
building
sky
building
sky
building
building
sky
building
sky
sky
building
building
building
sky
building
building
sky
sky
building
building
sky
building
sky
building
building
building
sky
sky
building
building
building
sky
sky
building
building
sky
sky
sky
sky
sky
...

output:

? 6799 1
? 6799 500000000000000001
? 6799 750000000000000001
? 6799 625000000000000001
? 6799 687500000000000001
? 6799 656250000000000001
? 6799 671875000000000001
? 6799 679687500000000001
? 6799 675781250000000001
? 6799 677734375000000001
? 6799 676757812500000001
? 6799 676269531250000001
? 679...

result:

ok Used 10437 queries

Test #47:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
building...

output:

? 42 1
? 42 500000000000000001
? 42 250000000000000001
? 42 125000000000000001
? 42 62500000000000001
? 42 31250000000000001
? 42 15625000000000001
? 42 7812500000000001
? 42 3906250000000001
? 42 1953125000000001
? 42 976562500000001
? 42 488281250000001
? 42 244140625000001
? 42 122070312500001
? ...

result:

ok Used 400 queries

Test #48:

score: 0
Accepted
time: 13ms
memory: 3656kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
sky
building
building
building
sky
building
building
building
sky
building
sky
sky
sky
building
building
building
sky
...

output:

? 8479 1
? 8479 500000000000000001
? 8479 250000000000000001
? 8479 125000000000000001
? 8479 62500000000000001
? 8479 31250000000000001
? 8479 15625000000000001
? 8479 7812500000000001
? 8479 3906250000000001
? 8479 1953125000000001
? 8479 976562500000001
? 8479 488281250000001
? 8479 2441406250000...

result:

ok Used 10240 queries

Test #49:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
bui...

output:

? 89 1
? 89 500000000000000001
? 89 250000000000000001
? 89 125000000000000001
? 89 62500000000000001
? 89 31250000000000001
? 89 15625000000000001
? 89 7812500000000001
? 89 3906250000000001
? 89 1953125000000001
? 89 976562500000001
? 89 488281250000001
? 89 244140625000001
? 89 122070312500001
? ...

result:

ok Used 322 queries

Test #50:

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

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
buildin...

output:

? 1361 1
? 1361 500000000000000001
? 1361 250000000000000001
? 1361 125000000000000001
? 1361 62500000000000001
? 1361 31250000000000001
? 1361 15625000000000001
? 1361 7812500000000001
? 1361 3906250000000001
? 1361 1953125000000001
? 1361 976562500000001
? 1361 488281250000001
? 1361 2441406250000...

result:

ok Used 319 queries

Test #51:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
sky
building
building
building
sky
building
building
building
sky
building
s...

output:

? 92 1
? 92 500000000000000001
? 92 250000000000000001
? 92 125000000000000001
? 92 62500000000000001
? 92 31250000000000001
? 92 15625000000000001
? 92 7812500000000001
? 92 3906250000000001
? 92 1953125000000001
? 92 976562500000001
? 92 488281250000001
? 92 244140625000001
? 92 122070312500001
? ...

result:

ok Used 459 queries

Test #52:

score: 0
Accepted
time: 3ms
memory: 3660kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
sky
building
building
building...

output:

? 8615 1
? 8615 500000000000000001
? 8615 250000000000000001
? 8615 125000000000000001
? 8615 62500000000000001
? 8615 31250000000000001
? 8615 15625000000000001
? 8615 7812500000000001
? 8615 3906250000000001
? 8615 1953125000000001
? 8615 976562500000001
? 8615 488281250000001
? 8615 2441406250000...

result:

ok Used 10240 queries

Test #53:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
bui...

output:

? 15 1
? 15 500000000000000001
? 15 250000000000000001
? 15 125000000000000001
? 15 62500000000000001
? 15 31250000000000001
? 15 15625000000000001
? 15 7812500000000001
? 15 3906250000000001
? 15 1953125000000001
? 15 976562500000001
? 15 488281250000001
? 15 244140625000001
? 15 122070312500001
? ...

result:

ok Used 310 queries

Test #54:

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

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
buildi...

output:

? 3713 1
? 3713 500000000000000001
? 3713 250000000000000001
? 3713 125000000000000001
? 3713 62500000000000001
? 3713 31250000000000001
? 3713 15625000000000001
? 3713 7812500000000001
? 3713 3906250000000001
? 3713 1953125000000001
? 3713 976562500000001
? 3713 488281250000001
? 3713 2441406250000...

result:

ok Used 477 queries

Test #55:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
building
building
sky
building
sky
sky...

output:

? 68 1
? 68 500000000000000001
? 68 250000000000000001
? 68 125000000000000001
? 68 62500000000000001
? 68 31250000000000001
? 68 15625000000000001
? 68 7812500000000001
? 68 3906250000000001
? 68 1953125000000001
? 68 976562500000001
? 68 488281250000001
? 68 244140625000001
? 68 122070312500001
? ...

result:

ok Used 459 queries

Test #56:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
building
sky
sky
building
sky
building
building
sky
building
building
sky
sky
sky
sky
building
building
building
sky
sky
building
sky
sky
building
building
sky
building
sky
building
sky
sky
sky
building
sky
sky
sky
sky...

output:

? 50 1
? 50 500000000000000001
? 50 250000000000000001
? 50 125000000000000001
? 50 62500000000000001
? 50 31250000000000001
? 50 15625000000000001
? 50 7812500000000001
? 50 3906250000000001
? 50 1953125000000001
? 50 976562500000001
? 50 1464843750000001
? 50 1220703125000001
? 50 1342773437500001...

result:

ok Used 458 queries

Test #57:

score: 0
Accepted
time: 5ms
memory: 3724kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
sky
sky
building
sky
sky
sky
building
sky
building
build...

output:

? 6574 1
? 6574 500000000000000001
? 6574 250000000000000001
? 6574 125000000000000001
? 6574 62500000000000001
? 6574 31250000000000001
? 6574 15625000000000001
? 6574 7812500000000001
? 6574 3906250000000001
? 6574 1953125000000001
? 6574 976562500000001
? 6574 488281250000001
? 6574 2441406250000...

result:

ok Used 10719 queries

Test #58:

score: 0
Accepted
time: 3ms
memory: 3696kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
building
building
sky
building
building
sky
building
sky
building
building
building
sky
building
sky
sky
sky
building
sky
building
sky
building
sky
building
sky
sky
sky
sky
sky
sky
building
building
build...

output:

? 3730 1
? 3730 500000000000000001
? 3730 250000000000000001
? 3730 125000000000000001
? 3730 62500000000000001
? 3730 31250000000000001
? 3730 15625000000000001
? 3730 7812500000000001
? 3730 3906250000000001
? 3730 1953125000000001
? 3730 976562500000001
? 3730 488281250000001
? 3730 2441406250000...

result:

ok Used 10359 queries

Test #59:

score: 0
Accepted
time: 8ms
memory: 3728kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
sky
sky
building
sky
building
sky
building
building
building
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
sky
building
sky
sky
sky
sky
sky
sky
building
building
bu...

output:

? 2294 1
? 2294 500000000000000001
? 2294 250000000000000001
? 2294 125000000000000001
? 2294 62500000000000001
? 2294 31250000000000001
? 2294 15625000000000001
? 2294 7812500000000001
? 2294 3906250000000001
? 2294 1953125000000001
? 2294 976562500000001
? 2294 488281250000001
? 2294 2441406250000...

result:

ok Used 10479 queries

Test #60:

score: 0
Accepted
time: 17ms
memory: 3632kb

input:

10000 1000000000000000000
building
building
building
sky
sky
building
sky
sky
building
sky
building
sky
building
building
building
building
sky
building
sky
building
building
sky
building
sky
building
sky
sky
building
sky
building
sky
building
sky
building
sky
building
sky
sky
building
building
sky
...

output:

? 5977 1
? 5977 500000000000000001
? 5977 750000000000000001
? 5977 875000000000000001
? 5977 812500000000000001
? 5977 781250000000000001
? 5977 796875000000000001
? 5977 789062500000000001
? 5977 785156250000000001
? 5977 787109375000000001
? 5977 786132812500000001
? 5977 786621093750000001
? 597...

result:

ok Used 10529 queries

Test #61:

score: 0
Accepted
time: 6ms
memory: 3620kb

input:

10000 1000000000000000000
building
building
sky
building
sky
sky
building
sky
building
building
sky
sky
sky
building
sky
building
sky
building
sky
sky
sky
sky
building
sky
sky
building
building
building
sky
building
sky
sky
building
building
building
sky
building
sky
sky
building
sky
building
sky
sk...

output:

? 9629 1
? 9629 500000000000000001
? 9629 750000000000000001
? 9629 625000000000000001
? 9629 687500000000000001
? 9629 656250000000000001
? 9629 640625000000000001
? 9629 648437500000000001
? 9629 644531250000000001
? 9629 646484375000000001
? 9629 647460937500000001
? 9629 646972656250000001
? 962...

result:

ok Used 10322 queries

Test #62:

score: 0
Accepted
time: 20ms
memory: 3688kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
sky
sky
building
building
building
build...

output:

? 7690 1
? 7690 500000000000000001
? 7690 250000000000000001
? 7690 125000000000000001
? 7690 62500000000000001
? 7690 31250000000000001
? 7690 15625000000000001
? 7690 7812500000000001
? 7690 3906250000000001
? 7690 1953125000000001
? 7690 976562500000001
? 7690 488281250000001
? 7690 2441406250000...

result:

ok Used 10779 queries

Test #63:

score: 0
Accepted
time: 19ms
memory: 3724kb

input:

10000 1000000000000000000
building
building
sky
sky
sky
sky
sky
sky
building
building
sky
sky
sky
building
building
sky
sky
building
sky
building
building
sky
building
sky
sky
building
building
building
building
sky
sky
building
sky
sky
sky
building
sky
sky
sky
sky
sky
sky
building
building
building...

output:

? 7608 1
? 7608 500000000000000001
? 7608 750000000000000001
? 7608 625000000000000001
? 7608 562500000000000001
? 7608 531250000000000001
? 7608 515625000000000001
? 7608 507812500000000001
? 7608 503906250000000001
? 7608 505859375000000001
? 7608 506835937500000001
? 7608 506347656250000001
? 760...

result:

ok Used 10269 queries

Test #64:

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

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
building
sky
building
building
sky
sky
building
sky
building
sky
building
building
building
building
sky
building
building
building
building
sky
sky
sky
sky
building
building
sky
building
sky
bui...

output:

? 6173 1
? 6173 500000000000000001
? 6173 250000000000000001
? 6173 125000000000000001
? 6173 62500000000000001
? 6173 31250000000000001
? 6173 15625000000000001
? 6173 7812500000000001
? 6173 3906250000000001
? 6173 1953125000000001
? 6173 976562500000001
? 6173 488281250000001
? 6173 7324218750000...

result:

ok Used 10298 queries