답안 #152228

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
152228 2019-09-06T21:14:33 Z TadijaSebez 새 집 (APIO18_new_home) C++11
80 / 100
5000 ms 415044 KB
#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];
	lst[c].reserve(l_segs.size());
rst[c].reserve(r_segs.size());
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:70:11: 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:95: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:96: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:98: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:105: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:106: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:108:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int mid=ss+se>>1;
          ~~^~~
new_home.cpp: In function 'int main()':
new_home.cpp:122:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<events.size();i++)
              ~^~~~~~~~~~~~~~
new_home.cpp:115: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:117: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:118: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 42 ms 42744 KB Output is correct
2 Correct 40 ms 42744 KB Output is correct
3 Correct 40 ms 42744 KB Output is correct
4 Correct 44 ms 42744 KB Output is correct
5 Correct 42 ms 42872 KB Output is correct
6 Correct 43 ms 43000 KB Output is correct
7 Correct 43 ms 42872 KB Output is correct
8 Correct 43 ms 43000 KB Output is correct
9 Correct 42 ms 42872 KB Output is correct
10 Correct 43 ms 43080 KB Output is correct
11 Correct 42 ms 42872 KB Output is correct
12 Correct 42 ms 43000 KB Output is correct
13 Correct 42 ms 42872 KB Output is correct
14 Correct 42 ms 42872 KB Output is correct
15 Correct 43 ms 42872 KB Output is correct
16 Correct 43 ms 43000 KB Output is correct
17 Correct 42 ms 42872 KB Output is correct
18 Correct 43 ms 43000 KB Output is correct
19 Correct 43 ms 43000 KB Output is correct
20 Correct 43 ms 43000 KB Output is correct
21 Correct 41 ms 42744 KB Output is correct
22 Correct 43 ms 42872 KB Output is correct
23 Correct 43 ms 43000 KB Output is correct
24 Correct 50 ms 43000 KB Output is correct
25 Correct 43 ms 43000 KB Output is correct
26 Correct 43 ms 42872 KB Output is correct
27 Correct 42 ms 42868 KB Output is correct
28 Correct 48 ms 42944 KB Output is correct
29 Correct 51 ms 42872 KB Output is correct
30 Correct 42 ms 42872 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 42 ms 42744 KB Output is correct
2 Correct 40 ms 42744 KB Output is correct
3 Correct 40 ms 42744 KB Output is correct
4 Correct 44 ms 42744 KB Output is correct
5 Correct 42 ms 42872 KB Output is correct
6 Correct 43 ms 43000 KB Output is correct
7 Correct 43 ms 42872 KB Output is correct
8 Correct 43 ms 43000 KB Output is correct
9 Correct 42 ms 42872 KB Output is correct
10 Correct 43 ms 43080 KB Output is correct
11 Correct 42 ms 42872 KB Output is correct
12 Correct 42 ms 43000 KB Output is correct
13 Correct 42 ms 42872 KB Output is correct
14 Correct 42 ms 42872 KB Output is correct
15 Correct 43 ms 42872 KB Output is correct
16 Correct 43 ms 43000 KB Output is correct
17 Correct 42 ms 42872 KB Output is correct
18 Correct 43 ms 43000 KB Output is correct
19 Correct 43 ms 43000 KB Output is correct
20 Correct 43 ms 43000 KB Output is correct
21 Correct 41 ms 42744 KB Output is correct
22 Correct 43 ms 42872 KB Output is correct
23 Correct 43 ms 43000 KB Output is correct
24 Correct 50 ms 43000 KB Output is correct
25 Correct 43 ms 43000 KB Output is correct
26 Correct 43 ms 42872 KB Output is correct
27 Correct 42 ms 42868 KB Output is correct
28 Correct 48 ms 42944 KB Output is correct
29 Correct 51 ms 42872 KB Output is correct
30 Correct 42 ms 42872 KB Output is correct
31 Correct 840 ms 112928 KB Output is correct
32 Correct 215 ms 62180 KB Output is correct
33 Correct 819 ms 109548 KB Output is correct
34 Correct 768 ms 108104 KB Output is correct
35 Correct 826 ms 113576 KB Output is correct
36 Correct 893 ms 114404 KB Output is correct
37 Correct 679 ms 103484 KB Output is correct
38 Correct 676 ms 103780 KB Output is correct
39 Correct 553 ms 95200 KB Output is correct
40 Correct 572 ms 97788 KB Output is correct
41 Correct 534 ms 88036 KB Output is correct
42 Correct 503 ms 88504 KB Output is correct
43 Correct 127 ms 55268 KB Output is correct
44 Correct 513 ms 89556 KB Output is correct
45 Correct 490 ms 86568 KB Output is correct
46 Correct 423 ms 81408 KB Output is correct
47 Correct 309 ms 76872 KB Output is correct
48 Correct 311 ms 76872 KB Output is correct
49 Correct 372 ms 81644 KB Output is correct
50 Correct 411 ms 86628 KB Output is correct
51 Correct 366 ms 80100 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1321 ms 110736 KB Output is correct
2 Correct 1616 ms 130776 KB Output is correct
3 Correct 1078 ms 108736 KB Output is correct
4 Correct 1192 ms 119508 KB Output is correct
5 Correct 1708 ms 130252 KB Output is correct
6 Correct 1716 ms 130632 KB Output is correct
7 Correct 999 ms 109660 KB Output is correct
8 Correct 1033 ms 119240 KB Output is correct
9 Correct 1035 ms 129100 KB Output is correct
10 Correct 1172 ms 131588 KB Output is correct
11 Correct 841 ms 129104 KB Output is correct
12 Correct 871 ms 130312 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3580 ms 276404 KB Output is correct
2 Correct 1035 ms 141140 KB Output is correct
3 Correct 4158 ms 298660 KB Output is correct
4 Correct 1408 ms 179448 KB Output is correct
5 Correct 2488 ms 251692 KB Output is correct
6 Correct 2068 ms 232872 KB Output is correct
7 Correct 4025 ms 298632 KB Output is correct
8 Correct 4054 ms 296576 KB Output is correct
9 Correct 1487 ms 180616 KB Output is correct
10 Correct 2521 ms 242084 KB Output is correct
11 Correct 3192 ms 279840 KB Output is correct
12 Correct 3706 ms 299508 KB Output is correct
13 Correct 1970 ms 254388 KB Output is correct
14 Correct 1946 ms 254072 KB Output is correct
15 Correct 2222 ms 272792 KB Output is correct
16 Correct 2451 ms 283348 KB Output is correct
17 Correct 2499 ms 280788 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 42 ms 42744 KB Output is correct
2 Correct 40 ms 42744 KB Output is correct
3 Correct 40 ms 42744 KB Output is correct
4 Correct 44 ms 42744 KB Output is correct
5 Correct 42 ms 42872 KB Output is correct
6 Correct 43 ms 43000 KB Output is correct
7 Correct 43 ms 42872 KB Output is correct
8 Correct 43 ms 43000 KB Output is correct
9 Correct 42 ms 42872 KB Output is correct
10 Correct 43 ms 43080 KB Output is correct
11 Correct 42 ms 42872 KB Output is correct
12 Correct 42 ms 43000 KB Output is correct
13 Correct 42 ms 42872 KB Output is correct
14 Correct 42 ms 42872 KB Output is correct
15 Correct 43 ms 42872 KB Output is correct
16 Correct 43 ms 43000 KB Output is correct
17 Correct 42 ms 42872 KB Output is correct
18 Correct 43 ms 43000 KB Output is correct
19 Correct 43 ms 43000 KB Output is correct
20 Correct 43 ms 43000 KB Output is correct
21 Correct 41 ms 42744 KB Output is correct
22 Correct 43 ms 42872 KB Output is correct
23 Correct 43 ms 43000 KB Output is correct
24 Correct 50 ms 43000 KB Output is correct
25 Correct 43 ms 43000 KB Output is correct
26 Correct 43 ms 42872 KB Output is correct
27 Correct 42 ms 42868 KB Output is correct
28 Correct 48 ms 42944 KB Output is correct
29 Correct 51 ms 42872 KB Output is correct
30 Correct 42 ms 42872 KB Output is correct
31 Correct 840 ms 112928 KB Output is correct
32 Correct 215 ms 62180 KB Output is correct
33 Correct 819 ms 109548 KB Output is correct
34 Correct 768 ms 108104 KB Output is correct
35 Correct 826 ms 113576 KB Output is correct
36 Correct 893 ms 114404 KB Output is correct
37 Correct 679 ms 103484 KB Output is correct
38 Correct 676 ms 103780 KB Output is correct
39 Correct 553 ms 95200 KB Output is correct
40 Correct 572 ms 97788 KB Output is correct
41 Correct 534 ms 88036 KB Output is correct
42 Correct 503 ms 88504 KB Output is correct
43 Correct 127 ms 55268 KB Output is correct
44 Correct 513 ms 89556 KB Output is correct
45 Correct 490 ms 86568 KB Output is correct
46 Correct 423 ms 81408 KB Output is correct
47 Correct 309 ms 76872 KB Output is correct
48 Correct 311 ms 76872 KB Output is correct
49 Correct 372 ms 81644 KB Output is correct
50 Correct 411 ms 86628 KB Output is correct
51 Correct 366 ms 80100 KB Output is correct
52 Correct 344 ms 78532 KB Output is correct
53 Correct 362 ms 77148 KB Output is correct
54 Correct 538 ms 95076 KB Output is correct
55 Correct 521 ms 91032 KB Output is correct
56 Correct 507 ms 89976 KB Output is correct
57 Correct 547 ms 90592 KB Output is correct
58 Correct 490 ms 88292 KB Output is correct
59 Correct 439 ms 86480 KB Output is correct
60 Correct 514 ms 89572 KB Output is correct
61 Correct 112 ms 54852 KB Output is correct
62 Correct 344 ms 78968 KB Output is correct
63 Correct 469 ms 88548 KB Output is correct
64 Correct 525 ms 92192 KB Output is correct
65 Correct 562 ms 94436 KB Output is correct
66 Correct 554 ms 92880 KB Output is correct
67 Correct 197 ms 62436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 42 ms 42744 KB Output is correct
2 Correct 40 ms 42744 KB Output is correct
3 Correct 40 ms 42744 KB Output is correct
4 Correct 44 ms 42744 KB Output is correct
5 Correct 42 ms 42872 KB Output is correct
6 Correct 43 ms 43000 KB Output is correct
7 Correct 43 ms 42872 KB Output is correct
8 Correct 43 ms 43000 KB Output is correct
9 Correct 42 ms 42872 KB Output is correct
10 Correct 43 ms 43080 KB Output is correct
11 Correct 42 ms 42872 KB Output is correct
12 Correct 42 ms 43000 KB Output is correct
13 Correct 42 ms 42872 KB Output is correct
14 Correct 42 ms 42872 KB Output is correct
15 Correct 43 ms 42872 KB Output is correct
16 Correct 43 ms 43000 KB Output is correct
17 Correct 42 ms 42872 KB Output is correct
18 Correct 43 ms 43000 KB Output is correct
19 Correct 43 ms 43000 KB Output is correct
20 Correct 43 ms 43000 KB Output is correct
21 Correct 41 ms 42744 KB Output is correct
22 Correct 43 ms 42872 KB Output is correct
23 Correct 43 ms 43000 KB Output is correct
24 Correct 50 ms 43000 KB Output is correct
25 Correct 43 ms 43000 KB Output is correct
26 Correct 43 ms 42872 KB Output is correct
27 Correct 42 ms 42868 KB Output is correct
28 Correct 48 ms 42944 KB Output is correct
29 Correct 51 ms 42872 KB Output is correct
30 Correct 42 ms 42872 KB Output is correct
31 Correct 840 ms 112928 KB Output is correct
32 Correct 215 ms 62180 KB Output is correct
33 Correct 819 ms 109548 KB Output is correct
34 Correct 768 ms 108104 KB Output is correct
35 Correct 826 ms 113576 KB Output is correct
36 Correct 893 ms 114404 KB Output is correct
37 Correct 679 ms 103484 KB Output is correct
38 Correct 676 ms 103780 KB Output is correct
39 Correct 553 ms 95200 KB Output is correct
40 Correct 572 ms 97788 KB Output is correct
41 Correct 534 ms 88036 KB Output is correct
42 Correct 503 ms 88504 KB Output is correct
43 Correct 127 ms 55268 KB Output is correct
44 Correct 513 ms 89556 KB Output is correct
45 Correct 490 ms 86568 KB Output is correct
46 Correct 423 ms 81408 KB Output is correct
47 Correct 309 ms 76872 KB Output is correct
48 Correct 311 ms 76872 KB Output is correct
49 Correct 372 ms 81644 KB Output is correct
50 Correct 411 ms 86628 KB Output is correct
51 Correct 366 ms 80100 KB Output is correct
52 Correct 1321 ms 110736 KB Output is correct
53 Correct 1616 ms 130776 KB Output is correct
54 Correct 1078 ms 108736 KB Output is correct
55 Correct 1192 ms 119508 KB Output is correct
56 Correct 1708 ms 130252 KB Output is correct
57 Correct 1716 ms 130632 KB Output is correct
58 Correct 999 ms 109660 KB Output is correct
59 Correct 1033 ms 119240 KB Output is correct
60 Correct 1035 ms 129100 KB Output is correct
61 Correct 1172 ms 131588 KB Output is correct
62 Correct 841 ms 129104 KB Output is correct
63 Correct 871 ms 130312 KB Output is correct
64 Correct 3580 ms 276404 KB Output is correct
65 Correct 1035 ms 141140 KB Output is correct
66 Correct 4158 ms 298660 KB Output is correct
67 Correct 1408 ms 179448 KB Output is correct
68 Correct 2488 ms 251692 KB Output is correct
69 Correct 2068 ms 232872 KB Output is correct
70 Correct 4025 ms 298632 KB Output is correct
71 Correct 4054 ms 296576 KB Output is correct
72 Correct 1487 ms 180616 KB Output is correct
73 Correct 2521 ms 242084 KB Output is correct
74 Correct 3192 ms 279840 KB Output is correct
75 Correct 3706 ms 299508 KB Output is correct
76 Correct 1970 ms 254388 KB Output is correct
77 Correct 1946 ms 254072 KB Output is correct
78 Correct 2222 ms 272792 KB Output is correct
79 Correct 2451 ms 283348 KB Output is correct
80 Correct 2499 ms 280788 KB Output is correct
81 Correct 344 ms 78532 KB Output is correct
82 Correct 362 ms 77148 KB Output is correct
83 Correct 538 ms 95076 KB Output is correct
84 Correct 521 ms 91032 KB Output is correct
85 Correct 507 ms 89976 KB Output is correct
86 Correct 547 ms 90592 KB Output is correct
87 Correct 490 ms 88292 KB Output is correct
88 Correct 439 ms 86480 KB Output is correct
89 Correct 514 ms 89572 KB Output is correct
90 Correct 112 ms 54852 KB Output is correct
91 Correct 344 ms 78968 KB Output is correct
92 Correct 469 ms 88548 KB Output is correct
93 Correct 525 ms 92192 KB Output is correct
94 Correct 562 ms 94436 KB Output is correct
95 Correct 554 ms 92880 KB Output is correct
96 Correct 197 ms 62436 KB Output is correct
97 Correct 1851 ms 237404 KB Output is correct
98 Correct 1087 ms 144592 KB Output is correct
99 Execution timed out 5123 ms 415044 KB Time limit exceeded
100 Halted 0 ms 0 KB -