QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#111753 | #6394. Turn on the Light | do_while_true# | AC ✓ | 5ms | 3416kb | C++14 | 2.2kb | 2023-06-08 15:02:17 | 2023-06-08 15:02:19 |
Judging History
answer
#include<cstdio>
#include<vector>
#include<queue>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<ctime>
#include<random>
#include<assert.h>
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define dbg(x) cerr<<"In Line "<< __LINE__<<" the "<<#x<<" = "<<x<<'\n';
#define dpi(x,y) cerr<<"In Line "<<__LINE__<<" the "<<#x<<" = "<<x<<" ; "<<"the "<<#y<<" = "<<y<<'\n';
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int>pii;
typedef pair<ll,int>pli;
typedef pair<ll,ll>pll;
typedef pair<int,ll>pil;
typedef vector<int>vi;
typedef vector<ll>vll;
typedef vector<pii>vpii;
typedef vector<pil>vpil;
template<typename T>T cmax(T &x, T y){return x=x>y?x:y;}
template<typename T>T cmin(T &x, T y){return x=x<y?x:y;}
template<typename T>
T &read(T &r){
r=0;bool w=0;char ch=getchar();
while(ch<'0'||ch>'9')w=ch=='-'?1:0,ch=getchar();
while(ch>='0'&&ch<='9')r=r*10+(ch^48),ch=getchar();
return r=w?-r:r;
}
template<typename T1,typename... T2>
void read(T1 &x,T2& ...y){read(x);read(y...);}
const int mod=998244353;
inline void cadd(int &x,int y){x=(x+y>=mod)?(x+y-mod):(x+y);}
inline void cdel(int &x,int y){x=(x-y<0)?(x-y+mod):(x-y);}
inline int add(int x,int y){return (x+y>=mod)?(x+y-mod):(x+y);}
inline int del(int x,int y){return (x-y<0)?(x-y+mod):(x-y);}
int qpow(int x,int y){
int s=1;
while(y){
if(y&1)s=1ll*s*x%mod;
x=1ll*x*x%mod;
y>>=1;
}
return s;
}
#define flh fflush(stdout)
const int N=1000010;
int n;
int lst=0;
int Query(int x){
cout << "? " << x << '\n';flh;
int y;read(y);
if(y==lst){
cout << "! " << x << '\n';
exit(0);
}
lst=y;
return y;
}
void solve(int l,int r,int sl,int sr){
if(l==r){
cout << "! " << l << '\n';
exit(0);
}
if(sl==sr){
Query(r);
sr++;
--r;
}
int mid=(l+r)>>1;
int t=Query(mid);
if(t==abs(sr+1-sl)){
solve(l,mid-1,sl,sr+1);
}
else{
solve(mid+1,r,sl+1,sr);
}
}
signed main(){
#ifdef do_while_true
// assert(freopen("data.in","r",stdin));
// assert(freopen("data.out","w",stdout));
#endif
read(n);
solve(1,n,0,0);
#ifdef do_while_true
cerr<<'\n'<<"Time:"<<1.0*clock()/CLOCKS_PER_SEC*1000<<" ms"<<'\n';
#endif
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3284kb
input:
3 0
output:
? 3 ! 3
result:
ok Correct position at 3
Test #2:
score: 0
Accepted
time: 2ms
memory: 3360kb
input:
10 1 0 1 0
output:
? 10 ? 5 ? 9 ? 7 ! 8
result:
ok Correct position at 8
Test #3:
score: 0
Accepted
time: 0ms
memory: 3236kb
input:
9 1 0 1 0
output:
? 9 ? 4 ? 8 ? 6 ! 7
result:
ok Correct position at 7
Test #4:
score: 0
Accepted
time: 3ms
memory: 3344kb
input:
8 1 0 1 0
output:
? 8 ? 4 ? 7 ? 5 ! 6
result:
ok Correct position at 6
Test #5:
score: 0
Accepted
time: 2ms
memory: 3408kb
input:
7 1 0 1 0
output:
? 7 ? 3 ? 6 ? 4 ! 5
result:
ok Correct position at 5
Test #6:
score: 0
Accepted
time: 3ms
memory: 3412kb
input:
6 1 0 1 1
output:
? 6 ? 3 ? 5 ? 4 ! 4
result:
ok Correct position at 4
Test #7:
score: 0
Accepted
time: 2ms
memory: 3228kb
input:
5 1 0 1 1
output:
? 5 ? 2 ? 4 ? 3 ! 3
result:
ok Correct position at 3
Test #8:
score: 0
Accepted
time: 0ms
memory: 3232kb
input:
4 1 1
output:
? 4 ? 2 ! 2
result:
ok Correct position at 2
Test #9:
score: 0
Accepted
time: 3ms
memory: 3284kb
input:
3 1 0
output:
? 3 ? 1 ! 2
result:
ok Correct position at 2
Test #10:
score: 0
Accepted
time: 2ms
memory: 3232kb
input:
2 1 1
output:
? 2 ? 1 ! 1
result:
ok Correct position at 1
Test #11:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
1
output:
! 1
result:
ok Correct position at 1
Test #12:
score: 0
Accepted
time: 3ms
memory: 3332kb
input:
1000000 1 0 1 0 1 0 1 0 1 0 1 0 1 2 1 2 1 0 1 0 1 0 1 0 1 2 3 2 3 2
output:
? 1000000 ? 500000 ? 999999 ? 749999 ? 999998 ? 874998 ? 999997 ? 937497 ? 999996 ? 968746 ? 999995 ? 984370 ? 999994 ? 992182 ? 988276 ? 990229 ? 989252 ? 989740 ? 990228 ? 989984 ? 990227 ? 990105 ? 990226 ? 990165 ? 990225 ? 990195 ? 990180 ? 990172 ? 990176 ? 990174 ! 990175
result:
ok Correct position at 990175
Test #13:
score: 0
Accepted
time: 4ms
memory: 3288kb
input:
999999 1 0 1 0 1 0 1 0 1 0 1 0 1 2 1 2 1 0 1 0 1 0 1 0 1 2 3 2 3 2
output:
? 999999 ? 499999 ? 999998 ? 749998 ? 999997 ? 874997 ? 999996 ? 937496 ? 999995 ? 968745 ? 999994 ? 984369 ? 999993 ? 992181 ? 988275 ? 990228 ? 989251 ? 989739 ? 990227 ? 989983 ? 990226 ? 990104 ? 990225 ? 990164 ? 990224 ? 990194 ? 990179 ? 990171 ? 990175 ? 990173 ! 990174
result:
ok Correct position at 990174
Test #14:
score: 0
Accepted
time: 2ms
memory: 3288kb
input:
999998 1 0 1 0 1 0 1 0 1 2 1 0 1 2 1 0 1 2 3 2 1 0 1 0 1 2 1 2
output:
? 999998 ? 499999 ? 999997 ? 749998 ? 999996 ? 874997 ? 999995 ? 937496 ? 999994 ? 968745 ? 953120 ? 960932 ? 968744 ? 964838 ? 962885 ? 963861 ? 964837 ? 964349 ? 964105 ? 963983 ? 964044 ? 964074 ? 964104 ? 964089 ? 964103 ? 964096 ? 964092 ? 964094 ! 964093
result:
ok Correct position at 964093
Test #15:
score: 0
Accepted
time: 4ms
memory: 3240kb
input:
999997 1 0 1 0 1 0 1 0 1 2 1 0 1 2 1 0 1 2 3 2 1 0 1 0 1 2 1 2
output:
? 999997 ? 499998 ? 999996 ? 749997 ? 999995 ? 874996 ? 999994 ? 937495 ? 999993 ? 968744 ? 953119 ? 960931 ? 968743 ? 964837 ? 962884 ? 963860 ? 964836 ? 964348 ? 964104 ? 963982 ? 964043 ? 964073 ? 964103 ? 964088 ? 964102 ? 964095 ? 964091 ? 964093 ! 964092
result:
ok Correct position at 964092
Test #16:
score: 0
Accepted
time: 5ms
memory: 3244kb
input:
999996 1 0 1 0 1 0 1 0 1 2 1 0 1 2 1 0 1 2 3 2 1 0 1 0 1 2 1 2
output:
? 999996 ? 499998 ? 999995 ? 749996 ? 999994 ? 874995 ? 999993 ? 937494 ? 999992 ? 968743 ? 953118 ? 960930 ? 968742 ? 964836 ? 962883 ? 963859 ? 964835 ? 964347 ? 964103 ? 963981 ? 964042 ? 964072 ? 964102 ? 964087 ? 964101 ? 964094 ? 964090 ? 964092 ! 964091
result:
ok Correct position at 964091
Test #17:
score: 0
Accepted
time: 1ms
memory: 3256kb
input:
999995 1 0 1 0 1 0 1 0 1 2 1 0 1 2 1 0 1 2 3 2 1 0 1 0 1 2 1 2
output:
? 999995 ? 499997 ? 999994 ? 749995 ? 999993 ? 874994 ? 999992 ? 937493 ? 999991 ? 968742 ? 953117 ? 960929 ? 968741 ? 964835 ? 962882 ? 963858 ? 964834 ? 964346 ? 964102 ? 963980 ? 964041 ? 964071 ? 964101 ? 964086 ? 964100 ? 964093 ? 964089 ? 964091 ! 964090
result:
ok Correct position at 964090
Test #18:
score: 0
Accepted
time: 1ms
memory: 3280kb
input:
999994 1 0 1 0 1 0 1 0 1 2 1 0 1 2 1 0 1 2 3 2 1 0 1 0 1 2 1 2
output:
? 999994 ? 499997 ? 999993 ? 749995 ? 999992 ? 874993 ? 999991 ? 937492 ? 999990 ? 968741 ? 953116 ? 960928 ? 968740 ? 964834 ? 962881 ? 963857 ? 964833 ? 964345 ? 964101 ? 963979 ? 964040 ? 964070 ? 964100 ? 964085 ? 964099 ? 964092 ? 964088 ? 964090 ! 964089
result:
ok Correct position at 964089
Test #19:
score: 0
Accepted
time: 4ms
memory: 3240kb
input:
999993 1 0 1 0 1 0 1 0 1 2 1 0 1 2 1 0 1 2 3 2 1 0 1 0 1 2 1 2
output:
? 999993 ? 499996 ? 999992 ? 749994 ? 999991 ? 874992 ? 999990 ? 937491 ? 999989 ? 968740 ? 953115 ? 960927 ? 968739 ? 964833 ? 962880 ? 963856 ? 964832 ? 964344 ? 964100 ? 963978 ? 964039 ? 964069 ? 964099 ? 964084 ? 964098 ? 964091 ? 964087 ? 964089 ! 964088
result:
ok Correct position at 964088
Test #20:
score: 0
Accepted
time: 4ms
memory: 3412kb
input:
999992 1 0 1 0 1 0 1 0 1 2 1 0 1 2 1 0 1 2 3 2 1 0 1 0 1 2 1 2
output:
? 999992 ? 499996 ? 999991 ? 749993 ? 999990 ? 874991 ? 999989 ? 937490 ? 999988 ? 968739 ? 953114 ? 960926 ? 968738 ? 964832 ? 962879 ? 963855 ? 964831 ? 964343 ? 964099 ? 963977 ? 964038 ? 964068 ? 964098 ? 964083 ? 964097 ? 964090 ? 964086 ? 964088 ! 964087
result:
ok Correct position at 964087
Test #21:
score: 0
Accepted
time: 4ms
memory: 3396kb
input:
999991 1 0 1 0 1 0 1 0 1 2 1 0 1 2 1 0 1 2 3 2 1 0 1 0 1 2 1 2
output:
? 999991 ? 499995 ? 999990 ? 749992 ? 999989 ? 874990 ? 999988 ? 937489 ? 999987 ? 968738 ? 953113 ? 960925 ? 968737 ? 964831 ? 962878 ? 963854 ? 964830 ? 964342 ? 964098 ? 963976 ? 964037 ? 964067 ? 964097 ? 964082 ? 964096 ? 964089 ? 964085 ? 964087 ! 964086
result:
ok Correct position at 964086
Test #22:
score: 0
Accepted
time: 2ms
memory: 3400kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 15 14 13 13
output:
? 1000000 ? 500000 ? 250000 ? 125000 ? 62500 ? 31250 ? 15625 ? 7812 ? 3906 ? 1953 ? 976 ? 488 ? 244 ? 122 ? 61 ? 30 ? 45 ? 37 ? 41 ? 43 ! 43
result:
ok Correct position at 43
Test #23:
score: 0
Accepted
time: 2ms
memory: 3364kb
input:
999999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 14 13 13
output:
? 999999 ? 499999 ? 249999 ? 124999 ? 62499 ? 31249 ? 15624 ? 7812 ? 3906 ? 1953 ? 976 ? 488 ? 244 ? 122 ? 61 ? 30 ? 45 ? 53 ? 49 ? 51 ! 51
result:
ok Correct position at 51
Test #24:
score: 0
Accepted
time: 3ms
memory: 3236kb
input:
999998 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 14 13 13
output:
? 999998 ? 499999 ? 249999 ? 124999 ? 62499 ? 31249 ? 15624 ? 7812 ? 3906 ? 1953 ? 976 ? 488 ? 244 ? 122 ? 61 ? 30 ? 45 ? 53 ? 49 ? 51 ! 51
result:
ok Correct position at 51
Test #25:
score: 0
Accepted
time: 1ms
memory: 3280kb
input:
999997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 14 13 13
output:
? 999997 ? 499998 ? 249999 ? 124999 ? 62499 ? 31249 ? 15624 ? 7812 ? 3906 ? 1953 ? 976 ? 488 ? 244 ? 122 ? 61 ? 30 ? 45 ? 53 ? 49 ? 51 ! 51
result:
ok Correct position at 51
Test #26:
score: 0
Accepted
time: 2ms
memory: 3236kb
input:
1000000 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2 3 2 3 4 3 2
output:
? 1000000 ? 500000 ? 999999 ? 749999 ? 999998 ? 874998 ? 999997 ? 937497 ? 999996 ? 968746 ? 999995 ? 984370 ? 999994 ? 992182 ? 999993 ? 996087 ? 999992 ? 998039 ? 999991 ? 999015 ? 999990 ? 999502 ? 999989 ? 999745 ? 999988 ? 999866 ? 999805 ? 999775 ? 999790 ? 999782 ? 999778 ? 999780 ! 999781
result:
ok Correct position at 999781
Test #27:
score: 0
Accepted
time: 2ms
memory: 3236kb
input:
999999 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1
output:
? 999999 ? 499999 ? 999998 ? 749998 ? 999997 ? 874997 ? 999996 ? 937496 ? 999995 ? 968745 ? 999994 ? 984369 ? 999993 ? 992181 ? 999992 ? 996086 ? 999991 ? 998038 ? 999990 ? 999014 ? 999989 ? 999501 ? 999988 ? 999744 ? 999987 ? 999865 ? 999986 ? 999925 ? 999985 ? 999955 ? 999984 ? 999969 ? 999983 ? 9...
result:
ok Correct position at 999980
Test #28:
score: 0
Accepted
time: 1ms
memory: 3244kb
input:
999998 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1
output:
? 999998 ? 499999 ? 999997 ? 749998 ? 999996 ? 874997 ? 999995 ? 937496 ? 999994 ? 968745 ? 999993 ? 984369 ? 999992 ? 992180 ? 999991 ? 996085 ? 999990 ? 998037 ? 999989 ? 999013 ? 999988 ? 999500 ? 999987 ? 999743 ? 999986 ? 999864 ? 999985 ? 999924 ? 999984 ? 999954 ? 999983 ? 999968 ? 999982 ? 9...
result:
ok Correct position at 999979
Test #29:
score: 0
Accepted
time: 4ms
memory: 3164kb
input:
999997 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1
output:
? 999997 ? 499998 ? 999996 ? 749997 ? 999995 ? 874996 ? 999994 ? 937495 ? 999993 ? 968744 ? 999992 ? 984368 ? 999991 ? 992179 ? 999990 ? 996084 ? 999989 ? 998036 ? 999988 ? 999012 ? 999987 ? 999499 ? 999986 ? 999742 ? 999985 ? 999863 ? 999984 ? 999923 ? 999983 ? 999953 ? 999982 ? 999967 ? 999981 ? 9...
result:
ok Correct position at 999978
Test #30:
score: 0
Accepted
time: 4ms
memory: 3396kb
input:
1000000 1 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2 1 2 1 2
output:
? 1000000 ? 500000 ? 250000 ? 375000 ? 499999 ? 437499 ? 499998 ? 468748 ? 499997 ? 484372 ? 499996 ? 492184 ? 499995 ? 496089 ? 499994 ? 498041 ? 499993 ? 499017 ? 499992 ? 499504 ? 499991 ? 499747 ? 499990 ? 499868 ? 499989 ? 499928 ? 499988 ? 499958 ? 499943 ? 499950 ? 499946 ? 499948 ! 499947
result:
ok Correct position at 499947
Test #31:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
999999 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 12 13 14 13 14 13
output:
? 999999 ? 499999 ? 999998 ? 749998 ? 624998 ? 562498 ? 531248 ? 515623 ? 507811 ? 503905 ? 501952 ? 500975 ? 500487 ? 500243 ? 500121 ? 500060 ? 500090 ? 500075 ? 500067 ? 500071 ? 500069 ! 500070
result:
ok Correct position at 500070
Test #32:
score: 0
Accepted
time: 0ms
memory: 3348kb
input:
999998 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 12 13 12 13 14 14
output:
? 999998 ? 499999 ? 999997 ? 749998 ? 624998 ? 562498 ? 531248 ? 515623 ? 507811 ? 503905 ? 501952 ? 500975 ? 500487 ? 500243 ? 500121 ? 500060 ? 500090 ? 500075 ? 500082 ? 500078 ? 500076 ! 500076
result:
ok Correct position at 500076
Test #33:
score: 0
Accepted
time: 1ms
memory: 3340kb
input:
999997 1 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2 1 2 1
output:
? 999997 ? 499998 ? 249999 ? 374998 ? 499997 ? 437497 ? 499996 ? 468746 ? 499995 ? 484370 ? 499994 ? 492182 ? 499993 ? 496087 ? 499992 ? 498039 ? 499991 ? 499015 ? 499990 ? 499502 ? 499989 ? 499745 ? 499988 ? 499866 ? 499987 ? 499926 ? 499986 ? 499956 ? 499985 ? 499970 ? 499963 ? 499966 ? 499964 ! 4...
result:
ok Correct position at 499965
Test #34:
score: 0
Accepted
time: 2ms
memory: 3364kb
input:
1000000 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0
output:
? 1000000 ? 500000 ? 999999 ? 749999 ? 999998 ? 874998 ? 999997 ? 937497 ? 999996 ? 968746 ? 999995 ? 984370 ? 999994 ? 992182 ? 999993 ? 996087 ? 999992 ? 998039 ? 999991 ? 999015 ? 999990 ? 999502 ? 999989 ? 999745 ? 999988 ? 999866 ? 999987 ? 999926 ? 999986 ? 999956 ? 999985 ? 999970 ? 999984 ? ...
result:
ok Correct position at 999982
Test #35:
score: 0
Accepted
time: 5ms
memory: 3408kb
input:
999999 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0
output:
? 999999 ? 499999 ? 999998 ? 749998 ? 999997 ? 874997 ? 999996 ? 937496 ? 999995 ? 968745 ? 999994 ? 984369 ? 999993 ? 992181 ? 999992 ? 996086 ? 999991 ? 998038 ? 999990 ? 999014 ? 999989 ? 999501 ? 999988 ? 999744 ? 999987 ? 999865 ? 999986 ? 999925 ? 999985 ? 999955 ? 999984 ? 999969 ? 999983 ? 9...
result:
ok Correct position at 999981
Test #36:
score: 0
Accepted
time: 2ms
memory: 3248kb
input:
999998 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0
output:
? 999998 ? 499999 ? 999997 ? 749998 ? 999996 ? 874997 ? 999995 ? 937496 ? 999994 ? 968745 ? 999993 ? 984369 ? 999992 ? 992180 ? 999991 ? 996085 ? 999990 ? 998037 ? 999989 ? 999013 ? 999988 ? 999500 ? 999987 ? 999743 ? 999986 ? 999864 ? 999985 ? 999924 ? 999984 ? 999954 ? 999983 ? 999968 ? 999982 ? 9...
result:
ok Correct position at 999980
Test #37:
score: 0
Accepted
time: 5ms
memory: 3232kb
input:
999997 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0
output:
? 999997 ? 499998 ? 999996 ? 749997 ? 999995 ? 874996 ? 999994 ? 937495 ? 999993 ? 968744 ? 999992 ? 984368 ? 999991 ? 992179 ? 999990 ? 996084 ? 999989 ? 998036 ? 999988 ? 999012 ? 999987 ? 999499 ? 999986 ? 999742 ? 999985 ? 999863 ? 999984 ? 999923 ? 999983 ? 999953 ? 999982 ? 999967 ? 999981 ? 9...
result:
ok Correct position at 999979
Test #38:
score: 0
Accepted
time: 0ms
memory: 3244kb
input:
1000000 1 2 3 4 5 6 7 6 5 4 5 4 3 2 1 2 1 2 3 4
output:
? 1000000 ? 500000 ? 250000 ? 125000 ? 62500 ? 31250 ? 15625 ? 7812 ? 11718 ? 13671 ? 14648 ? 14159 ? 14403 ? 14525 ? 14586 ? 14617 ? 14601 ? 14609 ? 14605 ? 14603 ! 14602
result:
ok Correct position at 14602
Test #39:
score: 0
Accepted
time: 1ms
memory: 3348kb
input:
999999 1 0 1 0 1 0 1 0 1 0 1 0 1 2 3 4 3 2 1 0 1 2 1 0 1 0 1 0 1 1
output:
? 999999 ? 499999 ? 999998 ? 749998 ? 999997 ? 874997 ? 999996 ? 937496 ? 999995 ? 968745 ? 999994 ? 984369 ? 999993 ? 992181 ? 988275 ? 986322 ? 985345 ? 985833 ? 986077 ? 986199 ? 986321 ? 986260 ? 986229 ? 986244 ? 986259 ? 986251 ? 986258 ? 986254 ? 986257 ? 986255 ! 986255
result:
ok Correct position at 986255
Test #40:
score: 0
Accepted
time: 0ms
memory: 3236kb
input:
999998 1 2 1 2 3 4 5 4 3 2 3 2 1 0 1 2 1 0 1 0 1 0 1 1
output:
? 999998 ? 499999 ? 249999 ? 374999 ? 312499 ? 281249 ? 265624 ? 257811 ? 261717 ? 263670 ? 264647 ? 264158 ? 264402 ? 264524 ? 264646 ? 264585 ? 264554 ? 264569 ? 264584 ? 264576 ? 264583 ? 264579 ? 264582 ? 264580 ! 264580
result:
ok Correct position at 264580
Test #41:
score: 0
Accepted
time: 2ms
memory: 3244kb
input:
999997 1 0 1 2 1 2 3 4 3 2 1 2 1 0 1 2 3 2 1 2 3 4
output:
? 999997 ? 499998 ? 999996 ? 749997 ? 624997 ? 687497 ? 656247 ? 640622 ? 632809 ? 636715 ? 638668 ? 639645 ? 639156 ? 639400 ? 639644 ? 639522 ? 639461 ? 639430 ? 639445 ? 639453 ? 639449 ? 639447 ! 639446
result:
ok Correct position at 639446
Test #42:
score: 0
Accepted
time: 2ms
memory: 3356kb
input:
1000000 0
output:
? 1000000 ! 1000000
result:
ok Correct position at 1000000
Test #43:
score: 0
Accepted
time: 2ms
memory: 3240kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 19
output:
? 1000000 ? 500000 ? 250000 ? 125000 ? 62500 ? 31250 ? 15625 ? 7812 ? 3906 ? 1953 ? 976 ? 488 ? 244 ? 122 ? 61 ? 30 ? 15 ? 7 ? 3 ? 1 ! 1
result:
ok Correct position at 1