QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#216596#5134. Jagged SkylineMovingUp#AC ✓34ms3588kbC++141.0kb2023-10-15 20:19:462023-10-15 20:19:47

Judging History

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

  • [2023-10-15 20:19:47]
  • 评测
  • 测评结果:AC
  • 用时:34ms
  • 内存:3588kb
  • [2023-10-15 20:19:46]
  • 提交

answer

#include <algorithm>
#include <iostream>
#include <random>
#include <vector>

using namespace std;

mt19937 mt(69);

bool isBuilding(int x, int64_t y) {
  cout << "? " << x << " " << y << endl;
  cout.flush();

  string response;
  cin >> response;

  return (response == "building");
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int w;
  int64_t h;
  cin >> w >> h;

  vector<int> columns(w);
  for (int i = 1; i <= w; i++) {
    columns[i - 1] = i;
  }

  shuffle(columns.begin(), columns.end(), mt);

  int colHighest = 1;
  int64_t currHighest = 0;
  for (auto col : columns) {
    if (currHighest == h) {
      break;
    }

    if (!isBuilding(col, currHighest + 1)) {
      continue;
    }

    int64_t low = currHighest + 2, high = h;
    while (low <= high) {
      int64_t mid = (low + high) / 2;

      if (isBuilding(col, mid))
        low = mid + 1;
      else
        high = mid - 1;
    }

    currHighest = low - 1;
    colHighest = col;
  }

  cout << "! " << colHighest << " " << currHighest << endl;
  cout.flush();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3420kb

input:

1 1
sky

output:

? 1 1
! 1 0

result:

ok Used 1 queries

Test #2:

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

input:

1 1
building

output:

? 1 1
! 1 1

result:

ok Used 1 queries

Test #3:

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

input:

2 1
sky
sky

output:

? 2 1
? 1 1
! 1 0

result:

ok Used 2 queries

Test #4:

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

input:

2 1
building

output:

? 2 1
! 2 1

result:

ok Used 1 queries

Test #5:

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

input:

2 1000000000000000000
sky
sky

output:

? 2 1
? 1 1
! 1 0

result:

ok Used 2 queries

Test #6:

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

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:

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

result:

ok Used 61 queries

Test #7:

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

input:

3 3
building
sky
sky
sky

output:

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

result:

ok Used 4 queries

Test #8:

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

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: 3444kb

input:

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

output:

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

result:

ok Used 10 queries

Test #10:

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

input:

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

output:

? 6 1
? 6 51
? 6 76
? 6 63
? 6 57
? 6 60
? 6 61
? 10 61
? 1 61
? 9 61
? 7 61
? 4 61
? 5 61
? 3 61
? 3 81
? 3 71
? 3 76
? 3 73
? 3 72
? 2 72
? 8 72
? 8 86
? 8 79
? 8 75
? 8 73
! 8 72

result:

ok Used 25 queries

Test #11:

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

input:

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

output:

? 52 1
? 52 501
? 52 251
? 52 126
? 52 63
? 52 32
? 52 16
? 52 24
? 52 20
? 52 18
? 52 17
? 42 17
? 42 509
? 42 755
? 42 878
? 42 816
? 42 785
? 42 770
? 42 777
? 42 773
? 42 771
? 78 771
? 49 771
? 7 771
? 91 771
? 94 771
? 34 771
? 2 771
? 2 886
? 2 943
? 2 914
? 2 928
? 2 935
? 2 939
? 2 941
? 2 ...

result:

ok Used 138 queries

Test #12:

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

input:

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

output:

? 52 1
? 52 6
? 52 8
? 52 9
? 42 9
? 78 9
? 49 9
? 7 9
? 91 9
? 94 9
? 34 9
? 2 9
? 18 9
? 18 10
? 72 10
? 24 10
? 69 10
? 58 10
? 20 10
? 10 10
? 53 10
! 53 10

result:

ok Used 21 queries

Test #13:

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

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: 0ms
memory: 3440kb

input:

899 2794
building
sky
building
building
sky
sky
building
sky
sky
building
sky
sky
building
sky
building
building
building
sky
building
sky
building
building
sky
sky
sky
sky
sky
building
building
sky
sky
sky
building
building
building
building
building
building
building
sky
sky
sky
sky
sky
building
s...

output:

? 350 1
? 350 1398
? 350 699
? 350 1048
? 350 1223
? 350 1135
? 350 1091
? 350 1113
? 350 1102
? 350 1096
? 350 1099
? 350 1097
? 608 1097
? 608 1946
? 608 1521
? 608 1733
? 608 1839
? 608 1892
? 608 1865
? 608 1878
? 608 1871
? 608 1874
? 608 1876
? 608 1875
? 372 1875
? 891 1875
? 283 1875
? 275 1...

result:

ok Used 956 queries

Test #15:

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

input:

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

output:

? 3805 1
? 3805 44
? 3805 65
? 3805 54
? 3805 49
? 3805 51
? 3805 50
? 4731 51
? 4731 69
? 4731 60
? 4731 55
? 4731 57
? 4731 56
? 4440 56
? 1738 56
? 1738 71
? 1738 79
? 1738 83
? 1738 81
? 1738 82
? 5247 82
? 6274 82
? 2449 82
? 3188 82
? 2154 82
? 4482 82
? 2504 82
? 616 82
? 1041 82
? 2662 82
? ...

result:

ok Used 87 queries

Test #16:

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

input:

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

output:

? 1591 1
? 1591 1045
? 1591 523
? 1591 262
? 1591 131
? 1591 196
? 1591 229
? 1591 212
? 1591 204
? 1591 208
? 1591 210
? 1591 211
? 3183 212
? 3183 1151
? 3183 1620
? 3183 1385
? 3183 1502
? 3183 1561
? 3183 1590
? 3183 1605
? 3183 1597
? 3183 1593
? 3183 1595
? 3183 1594
? 372 1594
? 891 1594
? 28...

result:

ok Used 184 queries

Test #17:

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

input:

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

output:

? 3808 1
? 3808 31967725
? 3808 15983863
? 3808 23975794
? 3808 19979828
? 3808 21977811
? 3808 22976802
? 3808 23476298
? 3808 23726046
? 3808 23850920
? 3808 23913357
? 3808 23944575
? 3808 23928966
? 3808 23936770
? 3808 23932868
? 3808 23930917
? 3808 23929941
? 3808 23929453
? 3808 23929697
? 3...

result:

ok Used 4037 queries

Test #18:

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

input:

3689 531350850216
building
sky
building
sky
building
building
sky
building
building
building
sky
sky
building
sky
building
building
building
building
sky
sky
sky
sky
sky
building
building
building
sky
sky
building
sky
sky
building
building
sky
building
building
sky
building
sky
sky
building
sky
buil...

output:

? 1591 1
? 1591 265675425109
? 1591 132837712555
? 1591 199256568832
? 1591 166047140693
? 1591 182651854762
? 1591 190954211797
? 1591 186803033279
? 1591 188878622538
? 1591 189916417167
? 1591 190435314482
? 1591 190175865824
? 1591 190046141495
? 1591 190111003659
? 1591 190078572577
? 1591 1900...

result:

ok Used 4123 queries

Test #19:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 625000000000000001
? 7913 562500000000000001
? 7913 593750000000000001
? 7913 609375000000000001
? 7913 617187500000000001
? 7913 613281250000000001
? 7913 615234375000000001
? 7913 616210937500000001
? 7913 615722656250000001
? 791...

result:

ok Used 10854 queries

Test #20:

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

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
building
sky
building
building
building
building
building
sky...

output:

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

result:

ok Used 10479 queries

Test #21:

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

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:

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

result:

ok Used 10059 queries

Test #22:

score: 0
Accepted
time: 22ms
memory: 3476kb

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:

? 7913 1
? 6778 1
? 9233 1
? 1738 1
? 8245 1
? 6274 1
? 2449 1
? 3188 1
? 2154 1
? 4482 1
? 2504 1
? 7912 1
? 1041 1
? 8344 1
? 402 1
? 4167 1
? 1857 1
? 1390 1
? 4625 1
? 5932 1
? 5668 1
? 5768 1
? 1788 1
? 2652 1
? 8081 1
? 5860 1
? 8561 1
? 5327 1
? 2838 1
? 2263 1
? 4446 1
? 3557 1
? 3553 1
? 39...

result:

ok Used 10059 queries

Test #23:

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

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:

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

result:

ok Used 10059 queries

Test #24:

score: 0
Accepted
time: 4ms
memory: 3464kb

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:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 937500000000000001
? 7913 968750000000000001
? 7913 984375000000000001
? 7913 992187500000000001
? 7913 996093750000000001
? 7913 998046875000000001
? 7913 999023437500000001
? 7913 999511718750000001
? 791...

result:

ok Used 5909 queries

Test #25:

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

input:

8 4
building
building
building

output:

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

result:

ok Used 3 queries

Test #26:

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

input:

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

output:

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

result:

ok Used 12 queries

Test #27:

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

input:

3 3
building
sky
building
building

output:

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

result:

ok Used 4 queries

Test #28:

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

input:

3 3
sky
sky
building
building
building

output:

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

result:

ok Used 5 queries

Test #29:

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

input:

5 5
building
sky
sky
sky
building
building
building

output:

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

result:

ok Used 7 queries

Test #30:

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

input:

8 4
building
building
sky
sky
sky
sky
sky
sky
building

output:

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

result:

ok Used 9 queries

Test #31:

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

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: 7ms
memory: 3576kb

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 812500000000000001
? 7913 781250000000000001
? 7913 796875000000000001
? 7913 789062500000000001
? 7913 792968750000000001
? 7913 794921875000000001
? 7913 793945312500000001
? 7913 794433593750000001
? 791...

result:

ok Used 10641 queries

Test #33:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 250000000000000001
? 7913 125000000000000001
? 7913 187500000000000001
? 7913 218750000000000001
? 7913 203125000000000001
? 7913 210937500000000001
? 7913 207031250000000001
? 7913 205078125000000001
? 7913 206054687500000001
? 7913 206542968750000001
? 791...

result:

ok Used 10760 queries

Test #34:

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

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
building
building
building
sky
building
building
building
sky
building
building
building
sky
buildin...

output:

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

result:

ok Used 10299 queries

Test #35:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 250000000000000001
? 7913 125000000000000001
? 7913 187500000000000001
? 7913 156250000000000001
? 7913 140625000000000001
? 7913 132812500000000001
? 7913 128906250000000001
? 7913 130859375000000001
? 7913 129882812500000001
? 7913 129394531250000001
? 791...

result:

ok Used 10426 queries

Test #36:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 250000000000000001
? 7913 125000000000000001
? 7913 187500000000000001
? 7913 156250000000000001
? 7913 171875000000000001
? 7913 164062500000000001
? 7913 167968750000000001
? 7913 169921875000000001
? 7913 168945312500000001
? 7913 168457031250000001
? 791...

result:

ok Used 11034 queries

Test #37:

score: 0
Accepted
time: 16ms
memory: 3580kb

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 937500000000000001
? 7913 906250000000000001
? 7913 921875000000000001
? 7913 914062500000000001
? 7913 917968750000000001
? 7913 919921875000000001
? 7913 918945312500000001
? 7913 919433593750000001
? 791...

result:

ok Used 10329 queries

Test #38:

score: 0
Accepted
time: 4ms
memory: 3456kb

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 812500000000000001
? 7913 781250000000000001
? 7913 796875000000000001
? 7913 789062500000000001
? 7913 785156250000000001
? 7913 787109375000000001
? 7913 788085937500000001
? 7913 787597656250000001
? 791...

result:

ok Used 10642 queries

Test #39:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 625000000000000001
? 7913 562500000000000001
? 7913 593750000000000001
? 7913 609375000000000001
? 7913 617187500000000001
? 7913 621093750000000001
? 7913 623046875000000001
? 7913 622070312500000001
? 7913 622558593750000001
? 791...

result:

ok Used 10652 queries

Test #40:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 812500000000000001
? 7913 781250000000000001
? 7913 796875000000000001
? 7913 789062500000000001
? 7913 792968750000000001
? 7913 794921875000000001
? 7913 793945312500000001
? 7913 793457031250000001
? 791...

result:

ok Used 10326 queries

Test #41:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 250000000000000001
? 7913 125000000000000001
? 7913 62500000000000001
? 7913 93750000000000001
? 7913 109375000000000001
? 7913 101562500000000001
? 7913 97656250000000001
? 7913 99609375000000001
? 7913 100585937500000001
? 7913 100097656250000001
? 7913 10...

result:

ok Used 10759 queries

Test #42:

score: 0
Accepted
time: 23ms
memory: 3516kb

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 250000000000000001
? 7913 125000000000000001
? 7913 187500000000000001
? 7913 218750000000000001
? 7913 203125000000000001
? 7913 210937500000000001
? 7913 207031250000000001
? 7913 208984375000000001
? 7913 209960937500000001
? 7913 210449218750000001
? 791...

result:

ok Used 10759 queries

Test #43:

score: 0
Accepted
time: 31ms
memory: 3480kb

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 625000000000000001
? 7913 687500000000000001
? 7913 656250000000000001
? 7913 671875000000000001
? 7913 664062500000000001
? 7913 667968750000000001
? 7913 669921875000000001
? 7913 670898437500000001
? 7913 671386718750000001
? 791...

result:

ok Used 10440 queries

Test #44:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 812500000000000001
? 7913 843750000000000001
? 7913 859375000000000001
? 7913 867187500000000001
? 7913 863281250000000001
? 7913 865234375000000001
? 7913 866210937500000001
? 7913 865722656250000001
? 791...

result:

ok Used 10472 queries

Test #45:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 250000000000000001
? 7913 125000000000000001
? 7913 62500000000000001
? 7913 93750000000000001
? 7913 78125000000000001
? 7913 70312500000000001
? 7913 74218750000000001
? 7913 76171875000000001
? 7913 77148437500000001
? 7913 77636718750000001
? 7913 773925...

result:

ok Used 10446 queries

Test #46:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 812500000000000001
? 7913 781250000000000001
? 7913 796875000000000001
? 7913 789062500000000001
? 7913 792968750000000001
? 7913 791015625000000001
? 7913 790039062500000001
? 7913 790527343750000001
? 791...

result:

ok Used 10642 queries

Test #47:

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

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
sky
sky
sky
sky
building
sky
building
sky
sky
sky
s...

output:

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

result:

ok Used 398 queries

Test #48:

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

input:

10000 1000000000000000000
building
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
sky
sky
sky
buildin...

output:

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

result:

ok Used 10239 queries

Test #49:

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

input:

100 1000000000000000000
building
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
building
building
building
b...

output:

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

result:

ok Used 251 queries

Test #50:

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

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
building
building
building
building
building
building
building
building
building
building
building
building
building
...

output:

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

result:

ok Used 314 queries

Test #51:

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

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
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
building
sky
sky...

output:

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

result:

ok Used 459 queries

Test #52:

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

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
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
sky
building
building
building
sky
building
building
b...

output:

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

result:

ok Used 10239 queries

Test #53:

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

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
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
sky
sky
s...

output:

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

result:

ok Used 305 queries

Test #54:

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

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
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
sky
sky...

output:

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

result:

ok Used 401 queries

Test #55:

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

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
sky
building
sky
building
sky
sky
building
sky
sky
...

output:

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

result:

ok Used 459 queries

Test #56:

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

input:

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

output:

? 52 1
? 52 500000000000000001
? 52 250000000000000001
? 52 125000000000000001
? 52 62500000000000001
? 52 31250000000000001
? 52 15625000000000001
? 52 7812500000000001
? 52 3906250000000001
? 52 1953125000000001
? 52 976562500000001
? 52 488281250000001
? 52 732421875000001
? 52 854492187500001
? ...

result:

ok Used 518 queries

Test #57:

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

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
building
sky
sky
sky
sky
building
building
sky
sky
building
sky
sky
sky
sky
b...

output:

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

result:

ok Used 10538 queries

Test #58:

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

input:

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

output:

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

result:

ok Used 10479 queries

Test #59:

score: 0
Accepted
time: 34ms
memory: 3456kb

input:

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

output:

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

result:

ok Used 10479 queries

Test #60:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 250000000000000001
? 7913 125000000000000001
? 7913 187500000000000001
? 7913 156250000000000001
? 7913 171875000000000001
? 7913 164062500000000001
? 7913 160156250000000001
? 7913 158203125000000001
? 7913 157226562500000001
? 7913 156738281250000001
? 791...

result:

ok Used 10653 queries

Test #61:

score: 0
Accepted
time: 22ms
memory: 3456kb

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 812500000000000001
? 7913 843750000000000001
? 7913 859375000000000001
? 7913 867187500000000001
? 7913 863281250000000001
? 7913 865234375000000001
? 7913 864257812500000001
? 7913 863769531250000001
? 791...

result:

ok Used 10430 queries

Test #62:

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

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
building
sky
building
sky
building
sky
sky
building
sky
building
...

output:

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

result:

ok Used 10539 queries

Test #63:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 750000000000000001
? 7913 875000000000000001
? 7913 812500000000000001
? 7913 781250000000000001
? 7913 796875000000000001
? 7913 804687500000000001
? 7913 800781250000000001
? 7913 802734375000000001
? 7913 801757812500000001
? 7913 802246093750000001
? 791...

result:

ok Used 10477 queries

Test #64:

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

input:

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

output:

? 7913 1
? 7913 500000000000000001
? 7913 250000000000000001
? 7913 125000000000000001
? 7913 62500000000000001
? 7913 31250000000000001
? 7913 15625000000000001
? 7913 7812500000000001
? 7913 3906250000000001
? 7913 1953125000000001
? 7913 976562500000001
? 7913 1464843750000001
? 7913 122070312500...

result:

ok Used 10778 queries