QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#104399 | #6394. Turn on the Light | maomao90 | AC ✓ | 5ms | 3480kb | C++17 | 1.6kb | 2023-05-10 16:54:13 | 2023-05-10 16:54:16 |
Judging History
answer
// Hallelujah, praise the one who set me free
// Hallelujah, death has lost its grip on me
// You have broken every chain, There's salvation in your name
// Jesus Christ, my living hope
#include <bits/stdc++.h>
using namespace std;
#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define RREP(i, s, e) for (int i = (s); i >= (e); i--)
template <class T>
inline bool mnto(T& a, T b) {return a > b ? a = b, 1 : 0;}
template <class T>
inline bool mxto(T& a, T b) {return a < b ? a = b, 1: 0;}
typedef long long ll;
typedef long double ld;
#define FI first
#define SE second
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> iii;
#define ALL(_a) _a.begin(), _a.end()
#define SZ(_a) (int) _a.size()
#define pb push_back
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<iii> viii;
#ifndef DEBUG
#define cerr if (0) cerr
#endif
const int INF = 1000000005;
const ll LINF = 1000000000000000005ll;
const int MAXN = 200005;
int n;
int ask(int x) {
cout << "? " << x << endl;
int res; cin >> res;
return res;
}
void answer(int x) {
cout << "! " << x << '\n';
}
int main() {
cin >> n;
REP (i, 1, min(20, n) + 1) {
if (ask(i) != i) {
answer(i);
return 0;
}
}
int prv = 20;
int lo = 21, hi = n, mid;
while (1) {
mid = lo + hi >> 1;
int nxt = ask(mid);
if (nxt == prv) {
answer(mid);
return 0;
}
if (nxt == prv + 1) {
lo = mid + 1;
} else {
assert(nxt == prv - 1);
hi = mid - 1;
}
prv = nxt;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 3ms
memory: 3284kb
input:
3 1 2 2
output:
? 1 ? 2 ? 3 ! 3
result:
ok Correct position at 3
Test #2:
score: 0
Accepted
time: 2ms
memory: 3268kb
input:
10 1 2 3 4 5 6 7 8 8
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ! 9
result:
ok Correct position at 9
Test #3:
score: 0
Accepted
time: 3ms
memory: 3416kb
input:
9 1 2 3 4 5 6 7 7
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ! 8
result:
ok Correct position at 8
Test #4:
score: 0
Accepted
time: 3ms
memory: 3280kb
input:
8 1 2 3 4 5 6 6
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ! 7
result:
ok Correct position at 7
Test #5:
score: 0
Accepted
time: 3ms
memory: 3408kb
input:
7 1 2 3 4 5 5
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ! 6
result:
ok Correct position at 6
Test #6:
score: 0
Accepted
time: 0ms
memory: 3408kb
input:
6 1 2 3 4 5 5
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ! 6
result:
ok Correct position at 6
Test #7:
score: 0
Accepted
time: 2ms
memory: 3292kb
input:
5 1 2 3 3
output:
? 1 ? 2 ? 3 ? 4 ! 4
result:
ok Correct position at 4
Test #8:
score: 0
Accepted
time: 2ms
memory: 3440kb
input:
4 1 2 3 3
output:
? 1 ? 2 ? 3 ? 4 ! 4
result:
ok Correct position at 4
Test #9:
score: 0
Accepted
time: 2ms
memory: 3284kb
input:
3 1 1
output:
? 1 ? 2 ! 2
result:
ok Correct position at 2
Test #10:
score: 0
Accepted
time: 2ms
memory: 3268kb
input:
2 1 1
output:
? 1 ? 2 ! 2
result:
ok Correct position at 2
Test #11:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
1 0
output:
? 1 ! 1
result:
ok Correct position at 1
Test #12:
score: 0
Accepted
time: 4ms
memory: 3480kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 22 23 24 25 26 27 28 29 30 31 32 31 32 31 32 33 33
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 750005 ? 875003 ? 937502 ? 906252 ? 921877 ? 929689 ? 933595 ? 935548 ? 936525 ? 937013 ? 937257 ? 937379 ? 937440 ? 937471 ? 937455 ? 937463 ? 937459 ? 937461 ? 937462 ! 937462
result:
ok Correct position at 937462
Test #13:
score: 0
Accepted
time: 5ms
memory: 3308kb
input:
999999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 18 19 18 19 20 21 22 23 24 25 26 27 28 27 28 27 28 29 29
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 250015 ? 125017 ? 187516 ? 156266 ? 171891 ? 179703 ? 183609 ? 185562 ? 186539 ? 187027 ? 187271 ? 187393 ? 187454 ? 187485 ? 187469 ? 187477 ? 187473 ? 187475 ? 187476 ! 187476
result:
ok Correct position at 187476
Test #14:
score: 0
Accepted
time: 0ms
memory: 3400kb
input:
999998 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 20 21 20 21 22 23 24 25 26 27 28 29 30 29 30 29 30 31 31
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 750004 ? 625006 ? 687505 ? 656255 ? 671880 ? 679692 ? 683598 ? 685551 ? 686528 ? 687016 ? 687260 ? 687382 ? 687443 ? 687474 ? 687458 ? 687466 ? 687462 ? 687464 ? 687465 ! 687465
result:
ok Correct position at 687465
Test #15:
score: 0
Accepted
time: 5ms
memory: 3396kb
input:
999997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 20 21 20 21 22 23 24 25 26 27 28 29 30 29 30 29 30 31 31
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 250014 ? 375011 ? 437510 ? 406260 ? 421885 ? 429697 ? 433603 ? 435556 ? 436533 ? 437021 ? 437265 ? 437387 ? 437448 ? 437479 ? 437463 ? 437471 ? 437467 ? 437469 ? 437470 ! 437470
result:
ok Correct position at 437470
Test #16:
score: 0
Accepted
time: 2ms
memory: 3280kb
input:
999996 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 22 23 24 25 26 27 28 29 30 31 32 31 32 31 32 33 33
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500008 ? 750002 ? 874999 ? 937498 ? 906248 ? 921873 ? 929685 ? 933591 ? 935544 ? 936521 ? 937009 ? 937253 ? 937375 ? 937436 ? 937467 ? 937451 ? 937459 ? 937455 ? 937457 ? 937458 ! 937458
result:
ok Correct position at 937458
Test #17:
score: 0
Accepted
time: 2ms
memory: 3388kb
input:
999995 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 18 19 20 21 22 23 24 25 26 27 28 29 30 29 30 29 30 31 31
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500008 ? 250014 ? 125017 ? 187515 ? 218764 ? 234389 ? 242201 ? 246107 ? 248060 ? 249037 ? 249525 ? 249769 ? 249891 ? 249952 ? 249983 ? 249967 ? 249975 ? 249971 ? 249973 ? 249974 ! 249974
result:
ok Correct position at 249974
Test #18:
score: 0
Accepted
time: 4ms
memory: 3408kb
input:
999994 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 20 21 22 23 24 25 26 27 28 29 30 31 32 31 32 31 32 33 33
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500007 ? 750001 ? 625004 ? 687502 ? 718751 ? 734376 ? 742188 ? 746094 ? 748047 ? 749024 ? 749512 ? 749756 ? 749878 ? 749939 ? 749970 ? 749954 ? 749962 ? 749958 ? 749960 ? 749961 ! 749961
result:
ok Correct position at 749961
Test #19:
score: 0
Accepted
time: 0ms
memory: 3296kb
input:
999993 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 20 21 22 23 24 25 26 27 28 29 30 31 32 31 32 31 32 33 33
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500007 ? 250013 ? 375010 ? 437508 ? 468757 ? 484382 ? 492194 ? 496100 ? 498053 ? 499030 ? 499518 ? 499762 ? 499884 ? 499945 ? 499976 ? 499960 ? 499968 ? 499964 ? 499966 ? 499967 ! 499967
result:
ok Correct position at 499967
Test #20:
score: 0
Accepted
time: 4ms
memory: 3276kb
input:
999992 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 33 34 33 34 35 35
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500006 ? 749999 ? 874996 ? 937494 ? 968743 ? 984368 ? 992180 ? 996086 ? 998039 ? 999016 ? 999504 ? 999748 ? 999870 ? 999931 ? 999962 ? 999946 ? 999954 ? 999950 ? 999952 ? 999953 ! 999953
result:
ok Correct position at 999953
Test #21:
score: 0
Accepted
time: 1ms
memory: 3324kb
input:
999991 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 18 19 20 21 22 23 24 25 26 27 28 29 30 29 30 29 30 31 31
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500006 ? 250013 ? 125016 ? 187514 ? 218763 ? 234388 ? 242200 ? 246106 ? 248059 ? 249036 ? 249524 ? 249768 ? 249890 ? 249951 ? 249982 ? 249966 ? 249974 ? 249970 ? 249972 ? 249973 ! 249973
result:
ok Correct position at 249973
Test #22:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 6 7 6 5 5
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 250015 ? 125017 ? 62518 ? 31269 ? 15644 ? 7832 ? 3926 ? 1973 ? 996 ? 508 ? 264 ? 142 ? 81 ? 50 ? 35 ? 42 ? 46 ? 44 ? 43 ! 43
result:
ok Correct position at 43
Test #23:
score: 0
Accepted
time: 4ms
memory: 3412kb
input:
999999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 7 6 5 4 4
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 250015 ? 125017 ? 62518 ? 31269 ? 15644 ? 7832 ? 3926 ? 1973 ? 996 ? 508 ? 264 ? 142 ? 81 ? 50 ? 65 ? 57 ? 53 ? 51 ! 51
result:
ok Correct position at 51
Test #24:
score: 0
Accepted
time: 5ms
memory: 3480kb
input:
999998 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 7 6 5 4 4
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 250014 ? 125017 ? 62518 ? 31269 ? 15644 ? 7832 ? 3926 ? 1973 ? 996 ? 508 ? 264 ? 142 ? 81 ? 50 ? 65 ? 57 ? 53 ? 51 ! 51
result:
ok Correct position at 51
Test #25:
score: 0
Accepted
time: 0ms
memory: 3344kb
input:
999997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 7 6 5 4 4
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 250014 ? 125017 ? 62518 ? 31269 ? 15644 ? 7832 ? 3926 ? 1973 ? 996 ? 508 ? 264 ? 142 ? 81 ? 50 ? 65 ? 57 ? 53 ? 51 ! 51
result:
ok Correct position at 51
Test #26:
score: 0
Accepted
time: 2ms
memory: 3392kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 31 30 29 30 31 30 31 31
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 750005 ? 875003 ? 937502 ? 968751 ? 984376 ? 992188 ? 996094 ? 998047 ? 999024 ? 999512 ? 999756 ? 999878 ? 999817 ? 999786 ? 999771 ? 999778 ? 999782 ? 999780 ? 999781 ! 999781
result:
ok Correct position at 999781
Test #27:
score: 0
Accepted
time: 2ms
memory: 3464kb
input:
999999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 34 35 35
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 750005 ? 875002 ? 937501 ? 968750 ? 984375 ? 992187 ? 996093 ? 998046 ? 999023 ? 999511 ? 999755 ? 999877 ? 999938 ? 999969 ? 999984 ? 999976 ? 999980 ! 999980
result:
ok Correct position at 999980
Test #28:
score: 0
Accepted
time: 4ms
memory: 3292kb
input:
999998 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 34 35 35
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 750004 ? 875001 ? 937500 ? 968749 ? 984374 ? 992186 ? 996092 ? 998045 ? 999022 ? 999510 ? 999754 ? 999876 ? 999937 ? 999968 ? 999983 ? 999975 ? 999979 ! 999979
result:
ok Correct position at 999979
Test #29:
score: 0
Accepted
time: 4ms
memory: 3480kb
input:
999997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 34 35 35
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 750003 ? 875000 ? 937499 ? 968748 ? 984373 ? 992185 ? 996091 ? 998044 ? 999021 ? 999509 ? 999753 ? 999875 ? 999936 ? 999967 ? 999982 ? 999974 ? 999978 ! 999978
result:
ok Correct position at 999978
Test #30:
score: 0
Accepted
time: 5ms
memory: 3308kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 20 21 22 23 24 25 26 27 28 29 30 31 30 31 32 33 34 35 35
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 250015 ? 375012 ? 437511 ? 468760 ? 484385 ? 492197 ? 496103 ? 498056 ? 499033 ? 499521 ? 499765 ? 499887 ? 499948 ? 499917 ? 499932 ? 499940 ? 499944 ? 499946 ? 499947 ! 499947
result:
ok Correct position at 499947
Test #31:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
999999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 20 19 18 17 16 15 14 13 12 11 10 9 8 9 10 11 12 13 13
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 750005 ? 625007 ? 562508 ? 531259 ? 515634 ? 507822 ? 503916 ? 501963 ? 500986 ? 500498 ? 500254 ? 500132 ? 500071 ? 500040 ? 500055 ? 500063 ? 500067 ? 500069 ? 500070 ! 500070
result:
ok Correct position at 500070
Test #32:
score: 0
Accepted
time: 2ms
memory: 3292kb
input:
999998 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 20 19 18 17 16 15 14 13 12 11 10 9 10 9 8 7 8 9 9
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 750004 ? 625006 ? 562507 ? 531258 ? 515633 ? 507821 ? 503915 ? 501962 ? 500985 ? 500497 ? 500253 ? 500131 ? 500070 ? 500100 ? 500085 ? 500077 ? 500073 ? 500075 ? 500076 ! 500076
result:
ok Correct position at 500076
Test #33:
score: 0
Accepted
time: 3ms
memory: 3268kb
input:
999997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 20 21 22 23 24 25 26 27 28 29 30 31 32 31 32 31 30 31 31
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 250014 ? 375011 ? 437510 ? 468759 ? 484384 ? 492196 ? 496102 ? 498055 ? 499032 ? 499520 ? 499764 ? 499886 ? 499947 ? 499978 ? 499962 ? 499970 ? 499966 ? 499964 ? 499965 ! 499965
result:
ok Correct position at 499965
Test #34:
score: 0
Accepted
time: 0ms
memory: 3352kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 21 20 21 20 21 22 23 22 23 24 25 26 25 26 25 24 23 23
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 750005 ? 875003 ? 812504 ? 781254 ? 796879 ? 789066 ? 792972 ? 794925 ? 795902 ? 795413 ? 795657 ? 795779 ? 795840 ? 795871 ? 795855 ? 795863 ? 795859 ? 795857 ? 795856 ! 795856
result:
ok Correct position at 795856
Test #35:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
999999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 18 19 18 19 18 19 20 21 20 21 22 23 24 23 24 23 22 21 21
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 250015 ? 125017 ? 187516 ? 156266 ? 171891 ? 164078 ? 167984 ? 169937 ? 170914 ? 170425 ? 170669 ? 170791 ? 170852 ? 170883 ? 170867 ? 170875 ? 170871 ? 170869 ? 170868 ! 170868
result:
ok Correct position at 170868
Test #36:
score: 0
Accepted
time: 5ms
memory: 3348kb
input:
999998 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 20 21 20 21 20 21 22 23 22 23 24 25 26 25 26 25 24 23 23
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 750004 ? 625006 ? 687505 ? 656255 ? 671880 ? 664067 ? 667973 ? 669926 ? 670903 ? 670414 ? 670658 ? 670780 ? 670841 ? 670872 ? 670856 ? 670864 ? 670860 ? 670858 ? 670857 ! 670857
result:
ok Correct position at 670857
Test #37:
score: 0
Accepted
time: 5ms
memory: 3464kb
input:
999997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 19 20 21 20 21 20 21 22 23 22 23 24 25 26 25 26 25 24 23 23
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 250014 ? 375011 ? 437510 ? 406260 ? 421885 ? 414072 ? 417978 ? 419931 ? 420908 ? 420419 ? 420663 ? 420785 ? 420846 ? 420877 ? 420861 ? 420869 ? 420865 ? 420863 ? 420862 ! 420862
result:
ok Correct position at 420862
Test #38:
score: 0
Accepted
time: 1ms
memory: 3324kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 39
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 750005 ? 875003 ? 937502 ? 968751 ? 984376 ? 992188 ? 996094 ? 998047 ? 999024 ? 999512 ? 999756 ? 999878 ? 999939 ? 999970 ? 999985 ? 999993 ? 999997 ? 999999 ? 1000000 ! 1000000
result:
ok Correct position at 1000000
Test #39:
score: 0
Accepted
time: 4ms
memory: 3312kb
input:
999999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 39
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 750005 ? 875002 ? 937501 ? 968750 ? 984375 ? 992187 ? 996093 ? 998046 ? 999023 ? 999511 ? 999755 ? 999877 ? 999938 ? 999969 ? 999984 ? 999992 ? 999996 ? 999998 ? 999999 ! 999999
result:
ok Correct position at 999999
Test #40:
score: 0
Accepted
time: 5ms
memory: 3284kb
input:
999998 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 39
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 750004 ? 875001 ? 937500 ? 968749 ? 984374 ? 992186 ? 996092 ? 998045 ? 999022 ? 999510 ? 999754 ? 999876 ? 999937 ? 999968 ? 999983 ? 999991 ? 999995 ? 999997 ? 999998 ! 999998
result:
ok Correct position at 999998
Test #41:
score: 0
Accepted
time: 2ms
memory: 3416kb
input:
999997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 39
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500009 ? 750003 ? 875000 ? 937499 ? 968748 ? 984373 ? 992185 ? 996091 ? 998044 ? 999021 ? 999509 ? 999753 ? 999875 ? 999936 ? 999967 ? 999982 ? 999990 ? 999994 ? 999996 ? 999997 ! 999997
result:
ok Correct position at 999997
Test #42:
score: 0
Accepted
time: 3ms
memory: 3400kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 39
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 ? 19 ? 20 ? 500010 ? 750005 ? 875003 ? 937502 ? 968751 ? 984376 ? 992188 ? 996094 ? 998047 ? 999024 ? 999512 ? 999756 ? 999878 ? 999939 ? 999970 ? 999985 ? 999993 ? 999997 ? 999999 ? 1000000 ! 1000000
result:
ok Correct position at 1000000
Test #43:
score: 0
Accepted
time: 1ms
memory: 3296kb
input:
1000000 0
output:
? 1 ! 1
result:
ok Correct position at 1