답안 #439220

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
439220 2021-06-29T11:53:26 Z kig9981 IOI 바이러스 (JOI21_fever) C++17
100 / 100
1592 ms 33920 KB
#include <bits/stdc++.h>

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

vector<int> x[4], X[4][100000];
vector<pair<int,int>> P;
int R[100000][8], dist[100000][8];

inline int get_d(int p, int d)
{
	switch(d&=3) {
		case 0: return P[p].first+P[p].second;
		case 1: return P[p].second;
		case 2: return P[p].first-P[p].second;
		case 3: return P[p].first;
	}
	return -1;
}

inline int get_d(int p)
{
	if(P[p].first>0) {
		if(P[p].second>=P[p].first) return 7;
		if(P[p].second<=-P[p].first) return 3;
		return 5;
	}
	if(P[p].second>-P[p].first) return 7;
	if(P[p].second<P[p].first) return 3;
	return 1;
}

inline int get_dist(int a, int b)
{
	if(P[a].first==P[b].first) return abs(P[a].second-P[b].second)>>1;
	if(P[a].second==P[b].second) return abs(P[a].first-P[b].first)>>1;
	return abs(P[a].first-P[b].first);
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	TEST(freopen("input.txt","r",stdin));
	TEST(freopen("output.txt","w",stdout));
	TEST(freopen("debug.txt","w",stderr));
	int N, ans=0, nxt[3], n;
	priority_queue<tuple<int,int,int>> Q;
	auto cmp=[&](int a, int b) {
		return P[a]<P[b];
	};
	auto cmp2=[&](pair<int,int> a, int b) {
		return a<P[b];
	};
	auto cmp3=[&](int a, pair<int,int> b) {
		return P[a]<b;
	};
	cin>>N; P.resize(N);
	for(int i=0;i<N;i++) {
		cin>>P[i].first>>P[i].second;
		P[i].first<<=1;
		P[i].second<<=1;
		if(i) {
			P[i].first-=P[0].first;
			P[i].second-=P[0].second;
		}
	}
	P[0]={0,0};
	for(int t=0;t<4;t++) {
		int res=0;
		memset(dist,0x7f,sizeof(dist));
		memset(R,-1,sizeof(R));
		for(int d=0;d<2;d++) Q.emplace(dist[0][d]=0,0,d);
		for(int d=0;d<4;d++) {
			x[d].clear();
			for(int i=0;i<N;i++) {
				x[d].push_back(get_d(i,d));
				X[d][i].clear();
			}
			sort(x[d].begin(),x[d].end()); x[d].resize(unique(x[d].begin(),x[d].end())-x[d].begin());
			for(int i=0;i<N;i++) X[d][lower_bound(x[d].begin(),x[d].end(),get_d(i,d))-x[d].begin()].push_back(i);
			for(int i=0;i<x[d].size();i++) {
				sort(X[d][i].begin(),X[d][i].end(),cmp);
				for(int j=1;j<X[d][i].size();j++) {
					R[X[d][i][j-1]][d]=X[d][i][j];
					R[X[d][i][j]][d|4]=X[d][i][j-1];
				}
			}
		}
		while(!Q.empty()) {
			auto[t,c,d]=Q.top();
			Q.pop();
			if(-t!=dist[c][d]) continue;
			nxt[0]=get_d(c);
			nxt[1]=nxt[0]-1;
			nxt[2]=(nxt[0]+1)&7;
			for(auto nd: nxt) {
				int j, dd=lower_bound(x[nd&3].begin(),x[nd&3].end(),get_d(c,nd))-x[nd&3].begin();
				if(nd&4) {
					if(nd==7) j=upper_bound(X[nd&3][dd].begin(),X[nd&3][dd].end(),make_pair(P[c].first,P[c].second-(dist[c][d]<<(nd&1))),cmp2)-X[nd&3][dd].begin()-1;
					else j=upper_bound(X[nd&3][dd].begin(),X[nd&3][dd].end(),make_pair(P[c].first-(dist[c][d]<<(nd&1)),0x7fffffff),cmp2)-X[nd&3][dd].begin()-1;
				}
				else {
					if(nd==3) j=lower_bound(X[nd][dd].begin(),X[nd][dd].end(),make_pair(P[c].first,P[c].second+(dist[c][d]<<(nd&1))),cmp3)-X[nd][dd].begin();
					else j=lower_bound(X[nd][dd].begin(),X[nd][dd].end(),make_pair(P[c].first+(dist[c][d]<<(nd&1)),-0x7fffffff),cmp3)-X[nd][dd].begin();
				}
				if(0<=j && j<X[nd&3][dd].size() && dist[n=X[nd&3][dd][j]][nd]>get_dist(c,n)) Q.emplace(-(dist[n][nd]=get_dist(c,n)),n,nd);
			}
			if((n=R[c][d])>-1 && dist[n][d]>dist[c][d]+get_dist(c,n)) Q.emplace(-(dist[n][d]=dist[c][d]+get_dist(c,n)),n,d);
		}
		for(int i=0;i<N;i++) for(int j=0;j<8;j++) if(dist[i][j]<0x7f7f7f7f) {
			res++;
			break;
		}
		ans=max(ans,res);
		for(auto &[x,y]: P) tie(x,y)=make_pair(y,-x);
	}
	cout<<ans<<'\n';
	return 0;
}

Compilation message

fever.cpp: In function 'int main()':
fever.cpp:89:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   89 |    for(int i=0;i<x[d].size();i++) {
      |                ~^~~~~~~~~~~~
fever.cpp:91:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   91 |     for(int j=1;j<X[d][i].size();j++) {
      |                 ~^~~~~~~~~~~~~~~
fever.cpp:114:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  114 |     if(0<=j && j<X[nd&3][dd].size() && dist[n=X[nd&3][dd][j]][nd]>get_dist(c,n)) Q.emplace(-(dist[n][nd]=get_dist(c,n)),n,nd);
      |                ~^~~~~~~~~~~~~~~~~~~
fever.cpp:114:46: warning: operation on 'n' may be undefined [-Wsequence-point]
  114 |     if(0<=j && j<X[nd&3][dd].size() && dist[n=X[nd&3][dd][j]][nd]>get_dist(c,n)) Q.emplace(-(dist[n][nd]=get_dist(c,n)),n,nd);
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 15948 KB Output is correct
2 Correct 11 ms 15868 KB Output is correct
3 Correct 13 ms 15860 KB Output is correct
4 Correct 12 ms 15948 KB Output is correct
5 Correct 11 ms 16036 KB Output is correct
6 Correct 13 ms 15948 KB Output is correct
7 Correct 13 ms 15948 KB Output is correct
8 Correct 12 ms 15860 KB Output is correct
9 Correct 12 ms 15948 KB Output is correct
10 Correct 13 ms 15936 KB Output is correct
11 Correct 12 ms 15948 KB Output is correct
12 Correct 12 ms 15980 KB Output is correct
13 Correct 12 ms 15948 KB Output is correct
14 Correct 12 ms 16036 KB Output is correct
15 Correct 12 ms 15948 KB Output is correct
16 Correct 11 ms 15948 KB Output is correct
17 Correct 13 ms 15948 KB Output is correct
18 Correct 12 ms 15896 KB Output is correct
19 Correct 12 ms 15948 KB Output is correct
20 Correct 13 ms 15948 KB Output is correct
21 Correct 12 ms 15948 KB Output is correct
22 Correct 11 ms 15948 KB Output is correct
23 Correct 12 ms 15964 KB Output is correct
24 Correct 12 ms 15864 KB Output is correct
25 Correct 12 ms 15948 KB Output is correct
26 Correct 12 ms 15964 KB Output is correct
27 Correct 11 ms 15904 KB Output is correct
28 Correct 12 ms 15948 KB Output is correct
29 Correct 12 ms 15948 KB Output is correct
30 Correct 13 ms 15948 KB Output is correct
31 Correct 12 ms 15948 KB Output is correct
32 Correct 12 ms 15968 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 15948 KB Output is correct
2 Correct 11 ms 15868 KB Output is correct
3 Correct 13 ms 15860 KB Output is correct
4 Correct 12 ms 15948 KB Output is correct
5 Correct 11 ms 16036 KB Output is correct
6 Correct 13 ms 15948 KB Output is correct
7 Correct 13 ms 15948 KB Output is correct
8 Correct 12 ms 15860 KB Output is correct
9 Correct 12 ms 15948 KB Output is correct
10 Correct 13 ms 15936 KB Output is correct
11 Correct 12 ms 15948 KB Output is correct
12 Correct 12 ms 15980 KB Output is correct
13 Correct 12 ms 15948 KB Output is correct
14 Correct 12 ms 16036 KB Output is correct
15 Correct 12 ms 15948 KB Output is correct
16 Correct 11 ms 15948 KB Output is correct
17 Correct 13 ms 15948 KB Output is correct
18 Correct 12 ms 15896 KB Output is correct
19 Correct 12 ms 15948 KB Output is correct
20 Correct 13 ms 15948 KB Output is correct
21 Correct 12 ms 15948 KB Output is correct
22 Correct 11 ms 15948 KB Output is correct
23 Correct 12 ms 15964 KB Output is correct
24 Correct 12 ms 15864 KB Output is correct
25 Correct 12 ms 15948 KB Output is correct
26 Correct 12 ms 15964 KB Output is correct
27 Correct 11 ms 15904 KB Output is correct
28 Correct 12 ms 15948 KB Output is correct
29 Correct 12 ms 15948 KB Output is correct
30 Correct 13 ms 15948 KB Output is correct
31 Correct 12 ms 15948 KB Output is correct
32 Correct 12 ms 15968 KB Output is correct
33 Correct 12 ms 15944 KB Output is correct
34 Correct 12 ms 15860 KB Output is correct
35 Correct 12 ms 15860 KB Output is correct
36 Correct 13 ms 15948 KB Output is correct
37 Correct 11 ms 15860 KB Output is correct
38 Correct 11 ms 15948 KB Output is correct
39 Correct 13 ms 15860 KB Output is correct
40 Correct 12 ms 15972 KB Output is correct
41 Correct 11 ms 15948 KB Output is correct
42 Correct 15 ms 15948 KB Output is correct
43 Correct 14 ms 15948 KB Output is correct
44 Correct 12 ms 15864 KB Output is correct
45 Correct 14 ms 15856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 15980 KB Output is correct
2 Correct 12 ms 15980 KB Output is correct
3 Correct 13 ms 15948 KB Output is correct
4 Correct 13 ms 15876 KB Output is correct
5 Correct 12 ms 15980 KB Output is correct
6 Correct 13 ms 15980 KB Output is correct
7 Correct 12 ms 15912 KB Output is correct
8 Correct 13 ms 15976 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 15948 KB Output is correct
2 Correct 11 ms 15868 KB Output is correct
3 Correct 13 ms 15860 KB Output is correct
4 Correct 12 ms 15948 KB Output is correct
5 Correct 11 ms 16036 KB Output is correct
6 Correct 13 ms 15948 KB Output is correct
7 Correct 13 ms 15948 KB Output is correct
8 Correct 12 ms 15860 KB Output is correct
9 Correct 12 ms 15948 KB Output is correct
10 Correct 13 ms 15936 KB Output is correct
11 Correct 12 ms 15948 KB Output is correct
12 Correct 12 ms 15980 KB Output is correct
13 Correct 12 ms 15948 KB Output is correct
14 Correct 12 ms 16036 KB Output is correct
15 Correct 12 ms 15948 KB Output is correct
16 Correct 11 ms 15948 KB Output is correct
17 Correct 13 ms 15948 KB Output is correct
18 Correct 12 ms 15896 KB Output is correct
19 Correct 12 ms 15948 KB Output is correct
20 Correct 13 ms 15948 KB Output is correct
21 Correct 12 ms 15948 KB Output is correct
22 Correct 11 ms 15948 KB Output is correct
23 Correct 12 ms 15964 KB Output is correct
24 Correct 12 ms 15864 KB Output is correct
25 Correct 12 ms 15948 KB Output is correct
26 Correct 12 ms 15964 KB Output is correct
27 Correct 11 ms 15904 KB Output is correct
28 Correct 12 ms 15948 KB Output is correct
29 Correct 12 ms 15948 KB Output is correct
30 Correct 13 ms 15948 KB Output is correct
31 Correct 12 ms 15948 KB Output is correct
32 Correct 12 ms 15968 KB Output is correct
33 Correct 12 ms 15944 KB Output is correct
34 Correct 12 ms 15860 KB Output is correct
35 Correct 12 ms 15860 KB Output is correct
36 Correct 13 ms 15948 KB Output is correct
37 Correct 11 ms 15860 KB Output is correct
38 Correct 11 ms 15948 KB Output is correct
39 Correct 13 ms 15860 KB Output is correct
40 Correct 12 ms 15972 KB Output is correct
41 Correct 11 ms 15948 KB Output is correct
42 Correct 15 ms 15948 KB Output is correct
43 Correct 14 ms 15948 KB Output is correct
44 Correct 12 ms 15864 KB Output is correct
45 Correct 14 ms 15856 KB Output is correct
46 Correct 12 ms 15980 KB Output is correct
47 Correct 12 ms 15980 KB Output is correct
48 Correct 13 ms 15948 KB Output is correct
49 Correct 13 ms 15876 KB Output is correct
50 Correct 12 ms 15980 KB Output is correct
51 Correct 13 ms 15980 KB Output is correct
52 Correct 12 ms 15912 KB Output is correct
53 Correct 13 ms 15976 KB Output is correct
54 Correct 12 ms 15988 KB Output is correct
55 Correct 15 ms 15988 KB Output is correct
56 Correct 12 ms 15948 KB Output is correct
57 Correct 14 ms 15960 KB Output is correct
58 Correct 12 ms 15948 KB Output is correct
59 Correct 12 ms 15948 KB Output is correct
60 Correct 13 ms 15984 KB Output is correct
61 Correct 13 ms 15988 KB Output is correct
62 Correct 15 ms 15948 KB Output is correct
63 Correct 12 ms 15980 KB Output is correct
64 Correct 12 ms 15948 KB Output is correct
65 Correct 12 ms 15948 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 15948 KB Output is correct
2 Correct 11 ms 15868 KB Output is correct
3 Correct 13 ms 15860 KB Output is correct
4 Correct 12 ms 15948 KB Output is correct
5 Correct 11 ms 16036 KB Output is correct
6 Correct 13 ms 15948 KB Output is correct
7 Correct 13 ms 15948 KB Output is correct
8 Correct 12 ms 15860 KB Output is correct
9 Correct 12 ms 15948 KB Output is correct
10 Correct 13 ms 15936 KB Output is correct
11 Correct 12 ms 15948 KB Output is correct
12 Correct 12 ms 15980 KB Output is correct
13 Correct 12 ms 15948 KB Output is correct
14 Correct 12 ms 16036 KB Output is correct
15 Correct 12 ms 15948 KB Output is correct
16 Correct 11 ms 15948 KB Output is correct
17 Correct 13 ms 15948 KB Output is correct
18 Correct 12 ms 15896 KB Output is correct
19 Correct 12 ms 15948 KB Output is correct
20 Correct 13 ms 15948 KB Output is correct
21 Correct 12 ms 15948 KB Output is correct
22 Correct 11 ms 15948 KB Output is correct
23 Correct 12 ms 15964 KB Output is correct
24 Correct 12 ms 15864 KB Output is correct
25 Correct 12 ms 15948 KB Output is correct
26 Correct 12 ms 15964 KB Output is correct
27 Correct 11 ms 15904 KB Output is correct
28 Correct 12 ms 15948 KB Output is correct
29 Correct 12 ms 15948 KB Output is correct
30 Correct 13 ms 15948 KB Output is correct
31 Correct 12 ms 15948 KB Output is correct
32 Correct 12 ms 15968 KB Output is correct
33 Correct 12 ms 15944 KB Output is correct
34 Correct 12 ms 15860 KB Output is correct
35 Correct 12 ms 15860 KB Output is correct
36 Correct 13 ms 15948 KB Output is correct
37 Correct 11 ms 15860 KB Output is correct
38 Correct 11 ms 15948 KB Output is correct
39 Correct 13 ms 15860 KB Output is correct
40 Correct 12 ms 15972 KB Output is correct
41 Correct 11 ms 15948 KB Output is correct
42 Correct 15 ms 15948 KB Output is correct
43 Correct 14 ms 15948 KB Output is correct
44 Correct 12 ms 15864 KB Output is correct
45 Correct 14 ms 15856 KB Output is correct
46 Correct 12 ms 15980 KB Output is correct
47 Correct 12 ms 15980 KB Output is correct
48 Correct 13 ms 15948 KB Output is correct
49 Correct 13 ms 15876 KB Output is correct
50 Correct 12 ms 15980 KB Output is correct
51 Correct 13 ms 15980 KB Output is correct
52 Correct 12 ms 15912 KB Output is correct
53 Correct 13 ms 15976 KB Output is correct
54 Correct 12 ms 15988 KB Output is correct
55 Correct 15 ms 15988 KB Output is correct
56 Correct 12 ms 15948 KB Output is correct
57 Correct 14 ms 15960 KB Output is correct
58 Correct 12 ms 15948 KB Output is correct
59 Correct 12 ms 15948 KB Output is correct
60 Correct 13 ms 15984 KB Output is correct
61 Correct 13 ms 15988 KB Output is correct
62 Correct 15 ms 15948 KB Output is correct
63 Correct 12 ms 15980 KB Output is correct
64 Correct 12 ms 15948 KB Output is correct
65 Correct 12 ms 15948 KB Output is correct
66 Correct 22 ms 16416 KB Output is correct
67 Correct 21 ms 16408 KB Output is correct
68 Correct 22 ms 16476 KB Output is correct
69 Correct 35 ms 16308 KB Output is correct
70 Correct 24 ms 16204 KB Output is correct
71 Correct 23 ms 16220 KB Output is correct
72 Correct 23 ms 16332 KB Output is correct
73 Correct 22 ms 16452 KB Output is correct
74 Correct 22 ms 16460 KB Output is correct
75 Correct 23 ms 16508 KB Output is correct
76 Correct 21 ms 16460 KB Output is correct
77 Correct 22 ms 16432 KB Output is correct
78 Correct 23 ms 16384 KB Output is correct
79 Correct 23 ms 16460 KB Output is correct
80 Correct 23 ms 16460 KB Output is correct
81 Correct 23 ms 16332 KB Output is correct
82 Correct 24 ms 16460 KB Output is correct
83 Correct 24 ms 16508 KB Output is correct
84 Correct 19 ms 16332 KB Output is correct
85 Correct 17 ms 16220 KB Output is correct
86 Correct 16 ms 16192 KB Output is correct
87 Correct 18 ms 16204 KB Output is correct
88 Correct 20 ms 16460 KB Output is correct
89 Correct 24 ms 16400 KB Output is correct
90 Correct 24 ms 16380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 15948 KB Output is correct
2 Correct 11 ms 15868 KB Output is correct
3 Correct 13 ms 15860 KB Output is correct
4 Correct 12 ms 15948 KB Output is correct
5 Correct 11 ms 16036 KB Output is correct
6 Correct 13 ms 15948 KB Output is correct
7 Correct 13 ms 15948 KB Output is correct
8 Correct 12 ms 15860 KB Output is correct
9 Correct 12 ms 15948 KB Output is correct
10 Correct 13 ms 15936 KB Output is correct
11 Correct 12 ms 15948 KB Output is correct
12 Correct 12 ms 15980 KB Output is correct
13 Correct 12 ms 15948 KB Output is correct
14 Correct 12 ms 16036 KB Output is correct
15 Correct 12 ms 15948 KB Output is correct
16 Correct 11 ms 15948 KB Output is correct
17 Correct 13 ms 15948 KB Output is correct
18 Correct 12 ms 15896 KB Output is correct
19 Correct 12 ms 15948 KB Output is correct
20 Correct 13 ms 15948 KB Output is correct
21 Correct 12 ms 15948 KB Output is correct
22 Correct 11 ms 15948 KB Output is correct
23 Correct 12 ms 15964 KB Output is correct
24 Correct 12 ms 15864 KB Output is correct
25 Correct 12 ms 15948 KB Output is correct
26 Correct 12 ms 15964 KB Output is correct
27 Correct 11 ms 15904 KB Output is correct
28 Correct 12 ms 15948 KB Output is correct
29 Correct 12 ms 15948 KB Output is correct
30 Correct 13 ms 15948 KB Output is correct
31 Correct 12 ms 15948 KB Output is correct
32 Correct 12 ms 15968 KB Output is correct
33 Correct 12 ms 15944 KB Output is correct
34 Correct 12 ms 15860 KB Output is correct
35 Correct 12 ms 15860 KB Output is correct
36 Correct 13 ms 15948 KB Output is correct
37 Correct 11 ms 15860 KB Output is correct
38 Correct 11 ms 15948 KB Output is correct
39 Correct 13 ms 15860 KB Output is correct
40 Correct 12 ms 15972 KB Output is correct
41 Correct 11 ms 15948 KB Output is correct
42 Correct 15 ms 15948 KB Output is correct
43 Correct 14 ms 15948 KB Output is correct
44 Correct 12 ms 15864 KB Output is correct
45 Correct 14 ms 15856 KB Output is correct
46 Correct 12 ms 15980 KB Output is correct
47 Correct 12 ms 15980 KB Output is correct
48 Correct 13 ms 15948 KB Output is correct
49 Correct 13 ms 15876 KB Output is correct
50 Correct 12 ms 15980 KB Output is correct
51 Correct 13 ms 15980 KB Output is correct
52 Correct 12 ms 15912 KB Output is correct
53 Correct 13 ms 15976 KB Output is correct
54 Correct 12 ms 15988 KB Output is correct
55 Correct 15 ms 15988 KB Output is correct
56 Correct 12 ms 15948 KB Output is correct
57 Correct 14 ms 15960 KB Output is correct
58 Correct 12 ms 15948 KB Output is correct
59 Correct 12 ms 15948 KB Output is correct
60 Correct 13 ms 15984 KB Output is correct
61 Correct 13 ms 15988 KB Output is correct
62 Correct 15 ms 15948 KB Output is correct
63 Correct 12 ms 15980 KB Output is correct
64 Correct 12 ms 15948 KB Output is correct
65 Correct 12 ms 15948 KB Output is correct
66 Correct 436 ms 27508 KB Output is correct
67 Correct 555 ms 30544 KB Output is correct
68 Correct 510 ms 32656 KB Output is correct
69 Correct 576 ms 32832 KB Output is correct
70 Correct 706 ms 33484 KB Output is correct
71 Correct 527 ms 32628 KB Output is correct
72 Correct 531 ms 32324 KB Output is correct
73 Correct 547 ms 32096 KB Output is correct
74 Correct 517 ms 32708 KB Output is correct
75 Correct 528 ms 32844 KB Output is correct
76 Correct 597 ms 32396 KB Output is correct
77 Correct 604 ms 32620 KB Output is correct
78 Correct 684 ms 29560 KB Output is correct
79 Correct 756 ms 29764 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 15948 KB Output is correct
2 Correct 11 ms 15868 KB Output is correct
3 Correct 13 ms 15860 KB Output is correct
4 Correct 12 ms 15948 KB Output is correct
5 Correct 11 ms 16036 KB Output is correct
6 Correct 13 ms 15948 KB Output is correct
7 Correct 13 ms 15948 KB Output is correct
8 Correct 12 ms 15860 KB Output is correct
9 Correct 12 ms 15948 KB Output is correct
10 Correct 13 ms 15936 KB Output is correct
11 Correct 12 ms 15948 KB Output is correct
12 Correct 12 ms 15980 KB Output is correct
13 Correct 12 ms 15948 KB Output is correct
14 Correct 12 ms 16036 KB Output is correct
15 Correct 12 ms 15948 KB Output is correct
16 Correct 11 ms 15948 KB Output is correct
17 Correct 13 ms 15948 KB Output is correct
18 Correct 12 ms 15896 KB Output is correct
19 Correct 12 ms 15948 KB Output is correct
20 Correct 13 ms 15948 KB Output is correct
21 Correct 12 ms 15948 KB Output is correct
22 Correct 11 ms 15948 KB Output is correct
23 Correct 12 ms 15964 KB Output is correct
24 Correct 12 ms 15864 KB Output is correct
25 Correct 12 ms 15948 KB Output is correct
26 Correct 12 ms 15964 KB Output is correct
27 Correct 11 ms 15904 KB Output is correct
28 Correct 12 ms 15948 KB Output is correct
29 Correct 12 ms 15948 KB Output is correct
30 Correct 13 ms 15948 KB Output is correct
31 Correct 12 ms 15948 KB Output is correct
32 Correct 12 ms 15968 KB Output is correct
33 Correct 12 ms 15944 KB Output is correct
34 Correct 12 ms 15860 KB Output is correct
35 Correct 12 ms 15860 KB Output is correct
36 Correct 13 ms 15948 KB Output is correct
37 Correct 11 ms 15860 KB Output is correct
38 Correct 11 ms 15948 KB Output is correct
39 Correct 13 ms 15860 KB Output is correct
40 Correct 12 ms 15972 KB Output is correct
41 Correct 11 ms 15948 KB Output is correct
42 Correct 15 ms 15948 KB Output is correct
43 Correct 14 ms 15948 KB Output is correct
44 Correct 12 ms 15864 KB Output is correct
45 Correct 14 ms 15856 KB Output is correct
46 Correct 12 ms 15980 KB Output is correct
47 Correct 12 ms 15980 KB Output is correct
48 Correct 13 ms 15948 KB Output is correct
49 Correct 13 ms 15876 KB Output is correct
50 Correct 12 ms 15980 KB Output is correct
51 Correct 13 ms 15980 KB Output is correct
52 Correct 12 ms 15912 KB Output is correct
53 Correct 13 ms 15976 KB Output is correct
54 Correct 12 ms 15988 KB Output is correct
55 Correct 15 ms 15988 KB Output is correct
56 Correct 12 ms 15948 KB Output is correct
57 Correct 14 ms 15960 KB Output is correct
58 Correct 12 ms 15948 KB Output is correct
59 Correct 12 ms 15948 KB Output is correct
60 Correct 13 ms 15984 KB Output is correct
61 Correct 13 ms 15988 KB Output is correct
62 Correct 15 ms 15948 KB Output is correct
63 Correct 12 ms 15980 KB Output is correct
64 Correct 12 ms 15948 KB Output is correct
65 Correct 12 ms 15948 KB Output is correct
66 Correct 22 ms 16416 KB Output is correct
67 Correct 21 ms 16408 KB Output is correct
68 Correct 22 ms 16476 KB Output is correct
69 Correct 35 ms 16308 KB Output is correct
70 Correct 24 ms 16204 KB Output is correct
71 Correct 23 ms 16220 KB Output is correct
72 Correct 23 ms 16332 KB Output is correct
73 Correct 22 ms 16452 KB Output is correct
74 Correct 22 ms 16460 KB Output is correct
75 Correct 23 ms 16508 KB Output is correct
76 Correct 21 ms 16460 KB Output is correct
77 Correct 22 ms 16432 KB Output is correct
78 Correct 23 ms 16384 KB Output is correct
79 Correct 23 ms 16460 KB Output is correct
80 Correct 23 ms 16460 KB Output is correct
81 Correct 23 ms 16332 KB Output is correct
82 Correct 24 ms 16460 KB Output is correct
83 Correct 24 ms 16508 KB Output is correct
84 Correct 19 ms 16332 KB Output is correct
85 Correct 17 ms 16220 KB Output is correct
86 Correct 16 ms 16192 KB Output is correct
87 Correct 18 ms 16204 KB Output is correct
88 Correct 20 ms 16460 KB Output is correct
89 Correct 24 ms 16400 KB Output is correct
90 Correct 24 ms 16380 KB Output is correct
91 Correct 436 ms 27508 KB Output is correct
92 Correct 555 ms 30544 KB Output is correct
93 Correct 510 ms 32656 KB Output is correct
94 Correct 576 ms 32832 KB Output is correct
95 Correct 706 ms 33484 KB Output is correct
96 Correct 527 ms 32628 KB Output is correct
97 Correct 531 ms 32324 KB Output is correct
98 Correct 547 ms 32096 KB Output is correct
99 Correct 517 ms 32708 KB Output is correct
100 Correct 528 ms 32844 KB Output is correct
101 Correct 597 ms 32396 KB Output is correct
102 Correct 604 ms 32620 KB Output is correct
103 Correct 684 ms 29560 KB Output is correct
104 Correct 756 ms 29764 KB Output is correct
105 Correct 705 ms 20892 KB Output is correct
106 Correct 853 ms 21984 KB Output is correct
107 Correct 1592 ms 22268 KB Output is correct
108 Correct 1090 ms 22512 KB Output is correct
109 Correct 474 ms 23456 KB Output is correct
110 Correct 602 ms 28240 KB Output is correct
111 Correct 591 ms 32780 KB Output is correct
112 Correct 628 ms 31172 KB Output is correct
113 Correct 609 ms 31204 KB Output is correct
114 Correct 1163 ms 27668 KB Output is correct
115 Correct 545 ms 31904 KB Output is correct
116 Correct 609 ms 31256 KB Output is correct
117 Correct 597 ms 31144 KB Output is correct
118 Correct 902 ms 30352 KB Output is correct
119 Correct 730 ms 32088 KB Output is correct
120 Correct 603 ms 31188 KB Output is correct
121 Correct 599 ms 32028 KB Output is correct
122 Correct 706 ms 31708 KB Output is correct
123 Correct 646 ms 32892 KB Output is correct
124 Correct 580 ms 33920 KB Output is correct
125 Correct 179 ms 27028 KB Output is correct
126 Correct 178 ms 23744 KB Output is correct
127 Correct 190 ms 22668 KB Output is correct
128 Correct 188 ms 23816 KB Output is correct
129 Correct 203 ms 24160 KB Output is correct