#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define l_type 0
#define r_type 1
const int N=300050;
const int mxx=1e8;
int x[N],t[N],a[N],b[N],qx[N],qt[N],n,q,k,ans[N],myl[N],myr[N];
struct cmp{ bool operator () (int i, int j) const { return x[i]<x[j] || (x[i]==x[j] && i<j);}};
set<int,cmp> house[N];
const int H=8*N;
int type[H],l[H],r[H],tl[H],tr[H],hsz;
int act[N],active,cur_time;
int Seg(int ty, int _l, int _r, int _tl){ hsz++;type[hsz]=ty;l[hsz]=_l;r[hsz]=_r;tl[hsz]=_tl;tr[hsz]=-1;return hsz;}
void S(int i, int j)
{
if(i==0) myr[j]=Seg(r_type,1,x[j],cur_time);
else if(j==0) myl[i]=Seg(l_type,x[i],mxx,cur_time);
else
{
int mid=x[i]+x[j]>>1;
myl[i]=Seg(l_type,x[i],mid,cur_time);
myr[j]=Seg(r_type,mid+((x[j]-x[i])%2==1),x[j],cur_time);
}
}
void E(int i, int j)
{
if(i!=0) tr[myl[i]]=cur_time-1;
if(j!=0) tr[myr[j]]=cur_time-1;
}
void Add(int i)
{
act[t[i]]++;if(act[t[i]]==1) active++;
house[t[i]].insert(i);
auto it=house[t[i]].find(i);
bool lf=0,rf=0;
auto L=it,R=it;
if(L!=house[t[i]].begin()) L--,lf=1;
R++;if(R!=house[t[i]].end()) rf=1;
if(lf && rf) E(*L,*R),S(*L,i),S(i,*R);
else if(lf) E(*L,0),S(*L,i),S(i,0);
else if(rf) E(0,*R),S(i,*R),S(0,i);
else S(0,i),S(i,0);
}
void Del(int i)
{
act[t[i]]--;if(act[t[i]]==0) active--;
auto it=house[t[i]].find(i);
bool lf=0,rf=0;
auto L=it,R=it;
if(L!=house[t[i]].begin()) L--,lf=1;
R++;if(R!=house[t[i]].end()) rf=1;
if(lf && rf) E(*L,i),E(i,*R),S(*L,*R);
else if(lf) E(*L,i),E(i,0),S(*L,0);
else if(rf) E(i,*R),E(0,i),S(0,*R);
else E(0,i),E(i,0);
house[t[i]].erase(i);
}
vector<int> cmpr_time;
int get_time_id(int x){ return lower_bound(cmpr_time.begin(),cmpr_time.end(),x)-cmpr_time.begin();}
const int M=2*N;
vector<int> lst[M],rst[M];
int ls[M],rs[M],tsz,root,lim,l_ptr[M],r_ptr[M];
void Build(int &c, int ss, int se, vector<int> l_segs, vector<int> r_segs)
{
c=++tsz;
vector<int> l_push[2],r_push[2];
int mid=ss+se>>1;
for(int i:l_segs)
{
if(tl[i]<=cmpr_time[ss] && tr[i]>=cmpr_time[se]) lst[c].pb(i);
else
{
if(tl[i]<=cmpr_time[mid]) l_push[0].pb(i);
if(tr[i]>=cmpr_time[mid+1]) l_push[1].pb(i);
}
}
for(int i:r_segs)
{
if(tl[i]<=cmpr_time[ss] && tr[i]>=cmpr_time[se]) rst[c].pb(i);
else
{
if(tl[i]<=cmpr_time[mid]) r_push[0].pb(i);
if(tr[i]>=cmpr_time[mid+1]) r_push[1].pb(i);
}
}
if(ss==se) return;
Build(ls[c],ss,mid,l_push[0],r_push[0]);
Build(rs[c],mid+1,se,l_push[1],r_push[1]);
}
int GetL(int c, int ss, int se, int id)
{
while(l_ptr[c]<lst[c].size() && r[lst[c][l_ptr[c]]]<qx[id]) l_ptr[c]++;
int ans=l_ptr[c]==lst[c].size()?0:qx[id]-l[lst[c][l_ptr[c]]];
if(ss==se) return ans;
int mid=ss+se>>1;
if(qt[id]<=cmpr_time[mid]) ans=max(ans,GetL(ls[c],ss,mid,id));
else ans=max(ans,GetL(rs[c],mid+1,se,id));
return ans;
}
int GetR(int c, int ss, int se, int id)
{
while(r_ptr[c]<rst[c].size() && l[rst[c][r_ptr[c]]]>qx[id]) r_ptr[c]++;
int ans=r_ptr[c]==rst[c].size()?0:r[rst[c][r_ptr[c]]]-qx[id];
if(ss==se) return ans;
int mid=ss+se>>1;
if(qt[id]<=cmpr_time[mid]) ans=max(ans,GetR(ls[c],ss,mid,id));
else ans=max(ans,GetR(rs[c],mid+1,se,id));
return ans;
}
int main()
{
scanf("%i %i %i",&n,&k,&q);
vector<pair<int,int>> events;
for(int i=1;i<=n;i++) scanf("%i %i %i %i",&x[i],&t[i],&a[i],&b[i]),events.pb({a[i],i}),events.pb({b[i]+1,-i});
for(int i=1;i<=q;i++) scanf("%i %i",&qx[i],&qt[i]),events.pb({qt[i],n+i}),cmpr_time.pb(qt[i]);
sort(cmpr_time.begin(),cmpr_time.end());
cmpr_time.resize(unique(cmpr_time.begin(),cmpr_time.end())-cmpr_time.begin());
sort(events.begin(),events.end());
for(int i=0;i<events.size();i++)
{
int id=events[i].second;
cur_time=events[i].first;
if(id<0) Del(-id);
else if(id<=n) Add(id);
else if(active!=k) ans[id-n]=-1;
}
for(int i=1;i<=hsz;i++) if(tr[i]==-1) tr[i]=cur_time;
vector<int> l_segs,r_segs;
l_segs.reserve(hsz);
r_segs.reserve(hsz);
for(int i=1;i<=hsz;i++) if(tl[i]<=tr[i]){ if(type[i]==l_type) l_segs.pb(i);else r_segs.pb(i);}
sort(l_segs.begin(),l_segs.end(),[&](int i, int j){ return l[i]<l[j];});
sort(r_segs.begin(),r_segs.end(),[&](int i, int j){ return r[i]>r[j];});
lim=(int)cmpr_time.size()-1;
Build(root,0,lim,l_segs,r_segs);
vector<int> qs;
for(int i=1;i<=q;i++) if(ans[i]!=-1) qs.pb(i);
sort(qs.begin(),qs.end(),[&](int i, int j){ return qx[i]<qx[j];});
for(int i:qs) ans[i]=GetL(root,0,lim,i);
reverse(qs.begin(),qs.end());
for(int i:qs) ans[i]=max(ans[i],GetR(root,0,lim,i));
for(int i=1;i<=q;i++) printf("%i\n",ans[i]);
return 0;
}
Compilation message
new_home.cpp: In function 'void S(int, int)':
new_home.cpp:21:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid=x[i]+x[j]>>1;
~~~~^~~~~
new_home.cpp: In function 'void Build(int&, int, int, std::vector<int>, std::vector<int>)':
new_home.cpp:68:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid=ss+se>>1;
~~^~~
new_home.cpp: In function 'int GetL(int, int, int, int)':
new_home.cpp:93:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while(l_ptr[c]<lst[c].size() && r[lst[c][l_ptr[c]]]<qx[id]) l_ptr[c]++;
~~~~~~~~^~~~~~~~~~~~~~
new_home.cpp:94:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
int ans=l_ptr[c]==lst[c].size()?0:qx[id]-l[lst[c][l_ptr[c]]];
~~~~~~~~^~~~~~~~~~~~~~~
new_home.cpp:96:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid=ss+se>>1;
~~^~~
new_home.cpp: In function 'int GetR(int, int, int, int)':
new_home.cpp:103:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while(r_ptr[c]<rst[c].size() && l[rst[c][r_ptr[c]]]>qx[id]) r_ptr[c]++;
~~~~~~~~^~~~~~~~~~~~~~
new_home.cpp:104:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
int ans=r_ptr[c]==rst[c].size()?0:r[rst[c][r_ptr[c]]]-qx[id];
~~~~~~~~^~~~~~~~~~~~~~~
new_home.cpp:106:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid=ss+se>>1;
~~^~~
new_home.cpp: In function 'int main()':
new_home.cpp:120:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<events.size();i++)
~^~~~~~~~~~~~~~
new_home.cpp:113:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%i %i %i",&n,&k,&q);
~~~~~^~~~~~~~~~~~~~~~~~~~~
new_home.cpp:115:88: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1;i<=n;i++) scanf("%i %i %i %i",&x[i],&t[i],&a[i],&b[i]),events.pb({a[i],i}),events.pb({b[i]+1,-i});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
new_home.cpp:116:75: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1;i<=q;i++) scanf("%i %i",&qx[i],&qt[i]),events.pb({qt[i],n+i}),cmpr_time.pb(qt[i]);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
42872 KB |
Output is correct |
2 |
Correct |
41 ms |
42744 KB |
Output is correct |
3 |
Correct |
47 ms |
42744 KB |
Output is correct |
4 |
Correct |
41 ms |
42704 KB |
Output is correct |
5 |
Correct |
41 ms |
42872 KB |
Output is correct |
6 |
Correct |
50 ms |
43000 KB |
Output is correct |
7 |
Correct |
42 ms |
42872 KB |
Output is correct |
8 |
Correct |
43 ms |
43000 KB |
Output is correct |
9 |
Correct |
42 ms |
43000 KB |
Output is correct |
10 |
Correct |
43 ms |
43000 KB |
Output is correct |
11 |
Correct |
42 ms |
42872 KB |
Output is correct |
12 |
Correct |
51 ms |
42872 KB |
Output is correct |
13 |
Correct |
42 ms |
42872 KB |
Output is correct |
14 |
Correct |
42 ms |
42876 KB |
Output is correct |
15 |
Correct |
42 ms |
42872 KB |
Output is correct |
16 |
Correct |
43 ms |
42872 KB |
Output is correct |
17 |
Correct |
43 ms |
42872 KB |
Output is correct |
18 |
Correct |
43 ms |
42872 KB |
Output is correct |
19 |
Correct |
45 ms |
43104 KB |
Output is correct |
20 |
Correct |
51 ms |
42872 KB |
Output is correct |
21 |
Correct |
47 ms |
42744 KB |
Output is correct |
22 |
Correct |
50 ms |
42872 KB |
Output is correct |
23 |
Correct |
51 ms |
42872 KB |
Output is correct |
24 |
Correct |
55 ms |
42940 KB |
Output is correct |
25 |
Correct |
52 ms |
43000 KB |
Output is correct |
26 |
Correct |
50 ms |
42972 KB |
Output is correct |
27 |
Correct |
50 ms |
43000 KB |
Output is correct |
28 |
Correct |
50 ms |
42872 KB |
Output is correct |
29 |
Correct |
50 ms |
42872 KB |
Output is correct |
30 |
Correct |
49 ms |
42872 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
42872 KB |
Output is correct |
2 |
Correct |
41 ms |
42744 KB |
Output is correct |
3 |
Correct |
47 ms |
42744 KB |
Output is correct |
4 |
Correct |
41 ms |
42704 KB |
Output is correct |
5 |
Correct |
41 ms |
42872 KB |
Output is correct |
6 |
Correct |
50 ms |
43000 KB |
Output is correct |
7 |
Correct |
42 ms |
42872 KB |
Output is correct |
8 |
Correct |
43 ms |
43000 KB |
Output is correct |
9 |
Correct |
42 ms |
43000 KB |
Output is correct |
10 |
Correct |
43 ms |
43000 KB |
Output is correct |
11 |
Correct |
42 ms |
42872 KB |
Output is correct |
12 |
Correct |
51 ms |
42872 KB |
Output is correct |
13 |
Correct |
42 ms |
42872 KB |
Output is correct |
14 |
Correct |
42 ms |
42876 KB |
Output is correct |
15 |
Correct |
42 ms |
42872 KB |
Output is correct |
16 |
Correct |
43 ms |
42872 KB |
Output is correct |
17 |
Correct |
43 ms |
42872 KB |
Output is correct |
18 |
Correct |
43 ms |
42872 KB |
Output is correct |
19 |
Correct |
45 ms |
43104 KB |
Output is correct |
20 |
Correct |
51 ms |
42872 KB |
Output is correct |
21 |
Correct |
47 ms |
42744 KB |
Output is correct |
22 |
Correct |
50 ms |
42872 KB |
Output is correct |
23 |
Correct |
51 ms |
42872 KB |
Output is correct |
24 |
Correct |
55 ms |
42940 KB |
Output is correct |
25 |
Correct |
52 ms |
43000 KB |
Output is correct |
26 |
Correct |
50 ms |
42972 KB |
Output is correct |
27 |
Correct |
50 ms |
43000 KB |
Output is correct |
28 |
Correct |
50 ms |
42872 KB |
Output is correct |
29 |
Correct |
50 ms |
42872 KB |
Output is correct |
30 |
Correct |
49 ms |
42872 KB |
Output is correct |
31 |
Correct |
928 ms |
94988 KB |
Output is correct |
32 |
Correct |
223 ms |
62540 KB |
Output is correct |
33 |
Correct |
858 ms |
95088 KB |
Output is correct |
34 |
Correct |
801 ms |
94128 KB |
Output is correct |
35 |
Correct |
867 ms |
95296 KB |
Output is correct |
36 |
Correct |
850 ms |
95264 KB |
Output is correct |
37 |
Correct |
687 ms |
87664 KB |
Output is correct |
38 |
Correct |
686 ms |
87776 KB |
Output is correct |
39 |
Correct |
538 ms |
80188 KB |
Output is correct |
40 |
Correct |
566 ms |
81636 KB |
Output is correct |
41 |
Correct |
543 ms |
75848 KB |
Output is correct |
42 |
Correct |
500 ms |
75824 KB |
Output is correct |
43 |
Correct |
127 ms |
57060 KB |
Output is correct |
44 |
Correct |
534 ms |
75708 KB |
Output is correct |
45 |
Correct |
498 ms |
72984 KB |
Output is correct |
46 |
Correct |
487 ms |
68688 KB |
Output is correct |
47 |
Correct |
309 ms |
66276 KB |
Output is correct |
48 |
Correct |
307 ms |
65808 KB |
Output is correct |
49 |
Correct |
392 ms |
69324 KB |
Output is correct |
50 |
Correct |
440 ms |
72968 KB |
Output is correct |
51 |
Correct |
372 ms |
68328 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1265 ms |
111276 KB |
Output is correct |
2 |
Correct |
1603 ms |
131596 KB |
Output is correct |
3 |
Correct |
1118 ms |
109756 KB |
Output is correct |
4 |
Correct |
1305 ms |
120432 KB |
Output is correct |
5 |
Correct |
1783 ms |
131132 KB |
Output is correct |
6 |
Correct |
1849 ms |
131552 KB |
Output is correct |
7 |
Correct |
1074 ms |
109752 KB |
Output is correct |
8 |
Correct |
1123 ms |
119704 KB |
Output is correct |
9 |
Correct |
1104 ms |
129440 KB |
Output is correct |
10 |
Correct |
1305 ms |
132548 KB |
Output is correct |
11 |
Correct |
886 ms |
130200 KB |
Output is correct |
12 |
Correct |
901 ms |
131016 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3852 ms |
226784 KB |
Output is correct |
2 |
Correct |
1031 ms |
136088 KB |
Output is correct |
3 |
Correct |
4186 ms |
248344 KB |
Output is correct |
4 |
Correct |
1454 ms |
152512 KB |
Output is correct |
5 |
Correct |
2314 ms |
201184 KB |
Output is correct |
6 |
Correct |
2130 ms |
190576 KB |
Output is correct |
7 |
Correct |
4327 ms |
247992 KB |
Output is correct |
8 |
Correct |
4635 ms |
248440 KB |
Output is correct |
9 |
Correct |
1470 ms |
155308 KB |
Output is correct |
10 |
Correct |
2496 ms |
204316 KB |
Output is correct |
11 |
Correct |
3390 ms |
232476 KB |
Output is correct |
12 |
Correct |
3749 ms |
249196 KB |
Output is correct |
13 |
Correct |
1936 ms |
206800 KB |
Output is correct |
14 |
Correct |
1974 ms |
206712 KB |
Output is correct |
15 |
Correct |
2408 ms |
219400 KB |
Output is correct |
16 |
Correct |
2597 ms |
227468 KB |
Output is correct |
17 |
Correct |
2497 ms |
225332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
42872 KB |
Output is correct |
2 |
Correct |
41 ms |
42744 KB |
Output is correct |
3 |
Correct |
47 ms |
42744 KB |
Output is correct |
4 |
Correct |
41 ms |
42704 KB |
Output is correct |
5 |
Correct |
41 ms |
42872 KB |
Output is correct |
6 |
Correct |
50 ms |
43000 KB |
Output is correct |
7 |
Correct |
42 ms |
42872 KB |
Output is correct |
8 |
Correct |
43 ms |
43000 KB |
Output is correct |
9 |
Correct |
42 ms |
43000 KB |
Output is correct |
10 |
Correct |
43 ms |
43000 KB |
Output is correct |
11 |
Correct |
42 ms |
42872 KB |
Output is correct |
12 |
Correct |
51 ms |
42872 KB |
Output is correct |
13 |
Correct |
42 ms |
42872 KB |
Output is correct |
14 |
Correct |
42 ms |
42876 KB |
Output is correct |
15 |
Correct |
42 ms |
42872 KB |
Output is correct |
16 |
Correct |
43 ms |
42872 KB |
Output is correct |
17 |
Correct |
43 ms |
42872 KB |
Output is correct |
18 |
Correct |
43 ms |
42872 KB |
Output is correct |
19 |
Correct |
45 ms |
43104 KB |
Output is correct |
20 |
Correct |
51 ms |
42872 KB |
Output is correct |
21 |
Correct |
47 ms |
42744 KB |
Output is correct |
22 |
Correct |
50 ms |
42872 KB |
Output is correct |
23 |
Correct |
51 ms |
42872 KB |
Output is correct |
24 |
Correct |
55 ms |
42940 KB |
Output is correct |
25 |
Correct |
52 ms |
43000 KB |
Output is correct |
26 |
Correct |
50 ms |
42972 KB |
Output is correct |
27 |
Correct |
50 ms |
43000 KB |
Output is correct |
28 |
Correct |
50 ms |
42872 KB |
Output is correct |
29 |
Correct |
50 ms |
42872 KB |
Output is correct |
30 |
Correct |
49 ms |
42872 KB |
Output is correct |
31 |
Correct |
928 ms |
94988 KB |
Output is correct |
32 |
Correct |
223 ms |
62540 KB |
Output is correct |
33 |
Correct |
858 ms |
95088 KB |
Output is correct |
34 |
Correct |
801 ms |
94128 KB |
Output is correct |
35 |
Correct |
867 ms |
95296 KB |
Output is correct |
36 |
Correct |
850 ms |
95264 KB |
Output is correct |
37 |
Correct |
687 ms |
87664 KB |
Output is correct |
38 |
Correct |
686 ms |
87776 KB |
Output is correct |
39 |
Correct |
538 ms |
80188 KB |
Output is correct |
40 |
Correct |
566 ms |
81636 KB |
Output is correct |
41 |
Correct |
543 ms |
75848 KB |
Output is correct |
42 |
Correct |
500 ms |
75824 KB |
Output is correct |
43 |
Correct |
127 ms |
57060 KB |
Output is correct |
44 |
Correct |
534 ms |
75708 KB |
Output is correct |
45 |
Correct |
498 ms |
72984 KB |
Output is correct |
46 |
Correct |
487 ms |
68688 KB |
Output is correct |
47 |
Correct |
309 ms |
66276 KB |
Output is correct |
48 |
Correct |
307 ms |
65808 KB |
Output is correct |
49 |
Correct |
392 ms |
69324 KB |
Output is correct |
50 |
Correct |
440 ms |
72968 KB |
Output is correct |
51 |
Correct |
372 ms |
68328 KB |
Output is correct |
52 |
Correct |
356 ms |
68904 KB |
Output is correct |
53 |
Correct |
369 ms |
69720 KB |
Output is correct |
54 |
Correct |
531 ms |
83016 KB |
Output is correct |
55 |
Correct |
518 ms |
79552 KB |
Output is correct |
56 |
Correct |
477 ms |
80324 KB |
Output is correct |
57 |
Correct |
539 ms |
77252 KB |
Output is correct |
58 |
Correct |
510 ms |
75952 KB |
Output is correct |
59 |
Correct |
453 ms |
75452 KB |
Output is correct |
60 |
Correct |
504 ms |
75776 KB |
Output is correct |
61 |
Correct |
120 ms |
54812 KB |
Output is correct |
62 |
Correct |
368 ms |
70588 KB |
Output is correct |
63 |
Correct |
505 ms |
77252 KB |
Output is correct |
64 |
Correct |
540 ms |
79852 KB |
Output is correct |
65 |
Correct |
582 ms |
81380 KB |
Output is correct |
66 |
Correct |
575 ms |
78136 KB |
Output is correct |
67 |
Correct |
195 ms |
61412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
42872 KB |
Output is correct |
2 |
Correct |
41 ms |
42744 KB |
Output is correct |
3 |
Correct |
47 ms |
42744 KB |
Output is correct |
4 |
Correct |
41 ms |
42704 KB |
Output is correct |
5 |
Correct |
41 ms |
42872 KB |
Output is correct |
6 |
Correct |
50 ms |
43000 KB |
Output is correct |
7 |
Correct |
42 ms |
42872 KB |
Output is correct |
8 |
Correct |
43 ms |
43000 KB |
Output is correct |
9 |
Correct |
42 ms |
43000 KB |
Output is correct |
10 |
Correct |
43 ms |
43000 KB |
Output is correct |
11 |
Correct |
42 ms |
42872 KB |
Output is correct |
12 |
Correct |
51 ms |
42872 KB |
Output is correct |
13 |
Correct |
42 ms |
42872 KB |
Output is correct |
14 |
Correct |
42 ms |
42876 KB |
Output is correct |
15 |
Correct |
42 ms |
42872 KB |
Output is correct |
16 |
Correct |
43 ms |
42872 KB |
Output is correct |
17 |
Correct |
43 ms |
42872 KB |
Output is correct |
18 |
Correct |
43 ms |
42872 KB |
Output is correct |
19 |
Correct |
45 ms |
43104 KB |
Output is correct |
20 |
Correct |
51 ms |
42872 KB |
Output is correct |
21 |
Correct |
47 ms |
42744 KB |
Output is correct |
22 |
Correct |
50 ms |
42872 KB |
Output is correct |
23 |
Correct |
51 ms |
42872 KB |
Output is correct |
24 |
Correct |
55 ms |
42940 KB |
Output is correct |
25 |
Correct |
52 ms |
43000 KB |
Output is correct |
26 |
Correct |
50 ms |
42972 KB |
Output is correct |
27 |
Correct |
50 ms |
43000 KB |
Output is correct |
28 |
Correct |
50 ms |
42872 KB |
Output is correct |
29 |
Correct |
50 ms |
42872 KB |
Output is correct |
30 |
Correct |
49 ms |
42872 KB |
Output is correct |
31 |
Correct |
928 ms |
94988 KB |
Output is correct |
32 |
Correct |
223 ms |
62540 KB |
Output is correct |
33 |
Correct |
858 ms |
95088 KB |
Output is correct |
34 |
Correct |
801 ms |
94128 KB |
Output is correct |
35 |
Correct |
867 ms |
95296 KB |
Output is correct |
36 |
Correct |
850 ms |
95264 KB |
Output is correct |
37 |
Correct |
687 ms |
87664 KB |
Output is correct |
38 |
Correct |
686 ms |
87776 KB |
Output is correct |
39 |
Correct |
538 ms |
80188 KB |
Output is correct |
40 |
Correct |
566 ms |
81636 KB |
Output is correct |
41 |
Correct |
543 ms |
75848 KB |
Output is correct |
42 |
Correct |
500 ms |
75824 KB |
Output is correct |
43 |
Correct |
127 ms |
57060 KB |
Output is correct |
44 |
Correct |
534 ms |
75708 KB |
Output is correct |
45 |
Correct |
498 ms |
72984 KB |
Output is correct |
46 |
Correct |
487 ms |
68688 KB |
Output is correct |
47 |
Correct |
309 ms |
66276 KB |
Output is correct |
48 |
Correct |
307 ms |
65808 KB |
Output is correct |
49 |
Correct |
392 ms |
69324 KB |
Output is correct |
50 |
Correct |
440 ms |
72968 KB |
Output is correct |
51 |
Correct |
372 ms |
68328 KB |
Output is correct |
52 |
Correct |
1265 ms |
111276 KB |
Output is correct |
53 |
Correct |
1603 ms |
131596 KB |
Output is correct |
54 |
Correct |
1118 ms |
109756 KB |
Output is correct |
55 |
Correct |
1305 ms |
120432 KB |
Output is correct |
56 |
Correct |
1783 ms |
131132 KB |
Output is correct |
57 |
Correct |
1849 ms |
131552 KB |
Output is correct |
58 |
Correct |
1074 ms |
109752 KB |
Output is correct |
59 |
Correct |
1123 ms |
119704 KB |
Output is correct |
60 |
Correct |
1104 ms |
129440 KB |
Output is correct |
61 |
Correct |
1305 ms |
132548 KB |
Output is correct |
62 |
Correct |
886 ms |
130200 KB |
Output is correct |
63 |
Correct |
901 ms |
131016 KB |
Output is correct |
64 |
Correct |
3852 ms |
226784 KB |
Output is correct |
65 |
Correct |
1031 ms |
136088 KB |
Output is correct |
66 |
Correct |
4186 ms |
248344 KB |
Output is correct |
67 |
Correct |
1454 ms |
152512 KB |
Output is correct |
68 |
Correct |
2314 ms |
201184 KB |
Output is correct |
69 |
Correct |
2130 ms |
190576 KB |
Output is correct |
70 |
Correct |
4327 ms |
247992 KB |
Output is correct |
71 |
Correct |
4635 ms |
248440 KB |
Output is correct |
72 |
Correct |
1470 ms |
155308 KB |
Output is correct |
73 |
Correct |
2496 ms |
204316 KB |
Output is correct |
74 |
Correct |
3390 ms |
232476 KB |
Output is correct |
75 |
Correct |
3749 ms |
249196 KB |
Output is correct |
76 |
Correct |
1936 ms |
206800 KB |
Output is correct |
77 |
Correct |
1974 ms |
206712 KB |
Output is correct |
78 |
Correct |
2408 ms |
219400 KB |
Output is correct |
79 |
Correct |
2597 ms |
227468 KB |
Output is correct |
80 |
Correct |
2497 ms |
225332 KB |
Output is correct |
81 |
Correct |
356 ms |
68904 KB |
Output is correct |
82 |
Correct |
369 ms |
69720 KB |
Output is correct |
83 |
Correct |
531 ms |
83016 KB |
Output is correct |
84 |
Correct |
518 ms |
79552 KB |
Output is correct |
85 |
Correct |
477 ms |
80324 KB |
Output is correct |
86 |
Correct |
539 ms |
77252 KB |
Output is correct |
87 |
Correct |
510 ms |
75952 KB |
Output is correct |
88 |
Correct |
453 ms |
75452 KB |
Output is correct |
89 |
Correct |
504 ms |
75776 KB |
Output is correct |
90 |
Correct |
120 ms |
54812 KB |
Output is correct |
91 |
Correct |
368 ms |
70588 KB |
Output is correct |
92 |
Correct |
505 ms |
77252 KB |
Output is correct |
93 |
Correct |
540 ms |
79852 KB |
Output is correct |
94 |
Correct |
582 ms |
81380 KB |
Output is correct |
95 |
Correct |
575 ms |
78136 KB |
Output is correct |
96 |
Correct |
195 ms |
61412 KB |
Output is correct |
97 |
Correct |
1915 ms |
193740 KB |
Output is correct |
98 |
Correct |
1141 ms |
142268 KB |
Output is correct |
99 |
Execution timed out |
5126 ms |
324152 KB |
Time limit exceeded |
100 |
Halted |
0 ms |
0 KB |
- |