Submission #55980

# Submission time Handle Problem Language Result Execution time Memory
55980 2018-07-09T08:51:40 Z 정원준(#1565) Telegraph (JOI16_telegraph) C++11
100 / 100
313 ms 23300 KB
#include <bits/stdc++.h>
#define L long long

using namespace std;

L n,costsum;

vector<L>v[100010],c[100010];

L chk[100010],color,chk2[100010],chk3[100010],chk4[100010],like,allcycle;
L allchk[100010];
L cycle[100010];
L cyclesum,macost;

L cycle_all(){
	L i;
	for(i=1;i<=n;i++)
	{
		if(v[i].size()!=1) return 0;
	}
	L x=1;
	allchk[x]=1;
	while(1)
	{
		if(allchk[v[x][0]]) break;
		else
		{
			allchk[v[x][0]]=1;
			x=v[x][0];
		}
	}
	for(i=1;i<=n;i++)
	{
		if(!allchk[i]) return 0;
	}
	return 1;
}

L dfs(L x){
	L i,ret=0;
	for(i=0;i<v[x].size();i++)
	{
		if(!chk[v[x][i]])
		{
			chk[v[x][i]]=color;
			ret|=dfs(v[x][i]);
		}
		else if(chk[v[x][i]]==color) ret=1;
	}
	return cycle[x]=ret;
}

L dfs2(L x){
	L i,plusma=0;
	if(cycle[x])
		for(i=0;i<v[x].size();i++)
		{
			if(!chk2[v[x][i]])
			{
				chk2[v[x][i]]=2;
				dfs2(v[x][i]);
			}
			if(cycle[v[x][i]])
			{
				cyclesum+=c[x][i];
			}
		}
	else
	{
		for(i=0;i<v[x].size();i++)
		{
			if(!chk2[v[x][i]])
			{
				chk2[v[x][i]]=2;
				dfs2(v[x][i]);
			}
			plusma=max(plusma,c[x][i]);
		}
		cyclesum+=plusma;
	}
}

L dfs3(L x){
	L i,sum=0;
	for(i=0;i<v[x].size();i++)
	{
		if(!chk3[v[x][i]])
		{
			chk3[v[x][i]]=3;
			dfs3(v[x][i]);
		}
		if(cycle[v[x][i]])
		{
			sum-=c[x][i];
		}
	}
	if(cycle[x])
	{
		//printf("%lld\n",x);
		macost=max(macost,cyclesum+sum);
		for(i=0;i<v[x].size();i++)
		{
			if(!cycle[v[x][i]])
			{
			//	printf("%lld %lld,",sum,c[x][i]);
				macost=max(macost,cyclesum+sum+c[x][i]);
			}
		}
		//puts("");
	}
}

L dfs4(L x){
	L i,ma=0,macycle=1;
	for(i=0;i<v[x].size();i++)
	{
		if(!chk4[v[x][i]])
		{
			chk4[v[x][i]]=4;
			dfs4(v[x][i]);
		}
		if(c[x][i]>ma)
		{
			if(cycle[x])
			{
				if(cycle[v[x][i]]) macycle=1;
				else macycle=0;
			}
			ma=c[x][i];
		}
	}
	like+=ma;
	if(macycle==0)allcycle=0;
}
int main()
{
	//freopen("input.txt","r",stdin);
	scanf("%lld",&n);
	L i;
	for(i=1;i<=n;i++)
	{
		L before,cost;
		scanf("%lld %lld",&before,&cost);
		v[before].push_back(i);
		c[before].push_back(cost);
		costsum+=cost;
	}
	if(cycle_all())
	{
		puts("0");
		return 0;
	}
	for(i=1;i<=n;i++)
	{
		if(!chk[i])
		{
			color++;
			chk[i]=color;
			L temp=dfs(i);
			if(temp==1)
			{
				cyclesum=0;
				chk2[i]=2;
				dfs2(i);
				chk3[i]=3;
				macost=0;
				dfs3(i);
				chk4[i]=4;
				like=0;
				allcycle=1;
				dfs4(i);
				if(allcycle==0) macost=max(macost,like);
				costsum-=macost;
				//printf("%lld %lld %lld %lld %lld\n",like,allcycle,i,cyclesum,macost);
			}
		}
	}
	for(i=1;i<=n;i++)
	{
	//	printf("%lld ",cycle[i]);
	}
	printf("%lld",costsum);
}

Compilation message

telegraph.cpp: In function 'long long int dfs(long long int)':
telegraph.cpp:41:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0;i<v[x].size();i++)
          ~^~~~~~~~~~~~
telegraph.cpp: In function 'long long int dfs2(long long int)':
telegraph.cpp:56:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0;i<v[x].size();i++)
           ~^~~~~~~~~~~~
telegraph.cpp:70:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0;i<v[x].size();i++)
           ~^~~~~~~~~~~~
telegraph.cpp:81:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
telegraph.cpp: In function 'long long int dfs3(long long int)':
telegraph.cpp:85:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0;i<v[x].size();i++)
          ~^~~~~~~~~~~~
telegraph.cpp:101:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0;i<v[x].size();i++)
           ~^~~~~~~~~~~~
telegraph.cpp:111:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
telegraph.cpp: In function 'long long int dfs4(long long int)':
telegraph.cpp:115:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0;i<v[x].size();i++)
          ~^~~~~~~~~~~~
telegraph.cpp:134:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
telegraph.cpp: In function 'int main()':
telegraph.cpp:138:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld",&n);
  ~~~~~^~~~~~~~~~~
telegraph.cpp:143:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %lld",&before,&cost);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 8 ms 4984 KB Output is correct
2 Correct 7 ms 5092 KB Output is correct
3 Correct 7 ms 5256 KB Output is correct
4 Correct 9 ms 5256 KB Output is correct
5 Correct 7 ms 5256 KB Output is correct
6 Correct 7 ms 5256 KB Output is correct
7 Correct 8 ms 5256 KB Output is correct
8 Correct 8 ms 5256 KB Output is correct
9 Correct 8 ms 5280 KB Output is correct
10 Correct 7 ms 5280 KB Output is correct
11 Correct 7 ms 5280 KB Output is correct
12 Correct 7 ms 5280 KB Output is correct
13 Correct 5 ms 5280 KB Output is correct
14 Correct 8 ms 5280 KB Output is correct
15 Correct 8 ms 5280 KB Output is correct
16 Correct 8 ms 5280 KB Output is correct
17 Correct 8 ms 5280 KB Output is correct
18 Correct 7 ms 5280 KB Output is correct
19 Correct 9 ms 5280 KB Output is correct
20 Correct 7 ms 5280 KB Output is correct
21 Correct 7 ms 5280 KB Output is correct
22 Correct 7 ms 5280 KB Output is correct
23 Correct 8 ms 5280 KB Output is correct
24 Correct 8 ms 5280 KB Output is correct
25 Correct 9 ms 5280 KB Output is correct
26 Correct 6 ms 5280 KB Output is correct
27 Correct 8 ms 5280 KB Output is correct
28 Correct 8 ms 5280 KB Output is correct
29 Correct 6 ms 5280 KB Output is correct
30 Correct 7 ms 5280 KB Output is correct
31 Correct 7 ms 5280 KB Output is correct
32 Correct 7 ms 5328 KB Output is correct
33 Correct 8 ms 5328 KB Output is correct
34 Correct 6 ms 5328 KB Output is correct
35 Correct 9 ms 5328 KB Output is correct
36 Correct 8 ms 5328 KB Output is correct
37 Correct 7 ms 5328 KB Output is correct
38 Correct 7 ms 5328 KB Output is correct
39 Correct 8 ms 5328 KB Output is correct
40 Correct 7 ms 5328 KB Output is correct
41 Correct 6 ms 5328 KB Output is correct
42 Correct 8 ms 5328 KB Output is correct
43 Correct 8 ms 5328 KB Output is correct
44 Correct 8 ms 5328 KB Output is correct
45 Correct 8 ms 5328 KB Output is correct
46 Correct 8 ms 5328 KB Output is correct
47 Correct 7 ms 5328 KB Output is correct
48 Correct 7 ms 5328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 4984 KB Output is correct
2 Correct 7 ms 5092 KB Output is correct
3 Correct 7 ms 5256 KB Output is correct
4 Correct 9 ms 5256 KB Output is correct
5 Correct 7 ms 5256 KB Output is correct
6 Correct 7 ms 5256 KB Output is correct
7 Correct 8 ms 5256 KB Output is correct
8 Correct 8 ms 5256 KB Output is correct
9 Correct 8 ms 5280 KB Output is correct
10 Correct 7 ms 5280 KB Output is correct
11 Correct 7 ms 5280 KB Output is correct
12 Correct 7 ms 5280 KB Output is correct
13 Correct 5 ms 5280 KB Output is correct
14 Correct 8 ms 5280 KB Output is correct
15 Correct 8 ms 5280 KB Output is correct
16 Correct 8 ms 5280 KB Output is correct
17 Correct 8 ms 5280 KB Output is correct
18 Correct 7 ms 5280 KB Output is correct
19 Correct 9 ms 5280 KB Output is correct
20 Correct 7 ms 5280 KB Output is correct
21 Correct 7 ms 5280 KB Output is correct
22 Correct 7 ms 5280 KB Output is correct
23 Correct 8 ms 5280 KB Output is correct
24 Correct 8 ms 5280 KB Output is correct
25 Correct 9 ms 5280 KB Output is correct
26 Correct 6 ms 5280 KB Output is correct
27 Correct 8 ms 5280 KB Output is correct
28 Correct 8 ms 5280 KB Output is correct
29 Correct 6 ms 5280 KB Output is correct
30 Correct 7 ms 5280 KB Output is correct
31 Correct 7 ms 5280 KB Output is correct
32 Correct 7 ms 5328 KB Output is correct
33 Correct 8 ms 5328 KB Output is correct
34 Correct 6 ms 5328 KB Output is correct
35 Correct 9 ms 5328 KB Output is correct
36 Correct 8 ms 5328 KB Output is correct
37 Correct 7 ms 5328 KB Output is correct
38 Correct 7 ms 5328 KB Output is correct
39 Correct 8 ms 5328 KB Output is correct
40 Correct 7 ms 5328 KB Output is correct
41 Correct 6 ms 5328 KB Output is correct
42 Correct 8 ms 5328 KB Output is correct
43 Correct 8 ms 5328 KB Output is correct
44 Correct 8 ms 5328 KB Output is correct
45 Correct 8 ms 5328 KB Output is correct
46 Correct 8 ms 5328 KB Output is correct
47 Correct 7 ms 5328 KB Output is correct
48 Correct 7 ms 5328 KB Output is correct
49 Correct 7 ms 5328 KB Output is correct
50 Correct 7 ms 5328 KB Output is correct
51 Correct 7 ms 5328 KB Output is correct
52 Correct 7 ms 5328 KB Output is correct
53 Correct 7 ms 5328 KB Output is correct
54 Correct 7 ms 5328 KB Output is correct
55 Correct 8 ms 5328 KB Output is correct
56 Correct 8 ms 5328 KB Output is correct
57 Correct 8 ms 5328 KB Output is correct
58 Correct 7 ms 5328 KB Output is correct
59 Correct 7 ms 5328 KB Output is correct
60 Correct 6 ms 5328 KB Output is correct
61 Correct 9 ms 5328 KB Output is correct
62 Correct 7 ms 5328 KB Output is correct
63 Correct 7 ms 5328 KB Output is correct
64 Correct 7 ms 5328 KB Output is correct
65 Correct 9 ms 5328 KB Output is correct
66 Correct 7 ms 5328 KB Output is correct
67 Correct 6 ms 5328 KB Output is correct
68 Correct 8 ms 5328 KB Output is correct
69 Correct 9 ms 5356 KB Output is correct
70 Correct 7 ms 5356 KB Output is correct
71 Correct 7 ms 5356 KB Output is correct
72 Correct 7 ms 5356 KB Output is correct
73 Correct 8 ms 5356 KB Output is correct
74 Correct 8 ms 5356 KB Output is correct
75 Correct 9 ms 5356 KB Output is correct
76 Correct 7 ms 5356 KB Output is correct
77 Correct 8 ms 5356 KB Output is correct
78 Correct 8 ms 5356 KB Output is correct
79 Correct 6 ms 5356 KB Output is correct
80 Correct 7 ms 5356 KB Output is correct
81 Correct 7 ms 5356 KB Output is correct
82 Correct 8 ms 5356 KB Output is correct
83 Correct 8 ms 5356 KB Output is correct
84 Correct 8 ms 5356 KB Output is correct
85 Correct 7 ms 5356 KB Output is correct
86 Correct 7 ms 5356 KB Output is correct
87 Correct 7 ms 5356 KB Output is correct
88 Correct 9 ms 5356 KB Output is correct
89 Correct 8 ms 5356 KB Output is correct
90 Correct 7 ms 5356 KB Output is correct
91 Correct 9 ms 5356 KB Output is correct
92 Correct 7 ms 5356 KB Output is correct
93 Correct 7 ms 5356 KB Output is correct
94 Correct 7 ms 5356 KB Output is correct
95 Correct 8 ms 5356 KB Output is correct
96 Correct 8 ms 5356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 4984 KB Output is correct
2 Correct 7 ms 5092 KB Output is correct
3 Correct 7 ms 5256 KB Output is correct
4 Correct 9 ms 5256 KB Output is correct
5 Correct 7 ms 5256 KB Output is correct
6 Correct 7 ms 5256 KB Output is correct
7 Correct 8 ms 5256 KB Output is correct
8 Correct 8 ms 5256 KB Output is correct
9 Correct 8 ms 5280 KB Output is correct
10 Correct 7 ms 5280 KB Output is correct
11 Correct 7 ms 5280 KB Output is correct
12 Correct 7 ms 5280 KB Output is correct
13 Correct 5 ms 5280 KB Output is correct
14 Correct 8 ms 5280 KB Output is correct
15 Correct 8 ms 5280 KB Output is correct
16 Correct 8 ms 5280 KB Output is correct
17 Correct 8 ms 5280 KB Output is correct
18 Correct 7 ms 5280 KB Output is correct
19 Correct 9 ms 5280 KB Output is correct
20 Correct 7 ms 5280 KB Output is correct
21 Correct 7 ms 5280 KB Output is correct
22 Correct 7 ms 5280 KB Output is correct
23 Correct 8 ms 5280 KB Output is correct
24 Correct 8 ms 5280 KB Output is correct
25 Correct 9 ms 5280 KB Output is correct
26 Correct 6 ms 5280 KB Output is correct
27 Correct 8 ms 5280 KB Output is correct
28 Correct 8 ms 5280 KB Output is correct
29 Correct 6 ms 5280 KB Output is correct
30 Correct 7 ms 5280 KB Output is correct
31 Correct 7 ms 5280 KB Output is correct
32 Correct 7 ms 5328 KB Output is correct
33 Correct 8 ms 5328 KB Output is correct
34 Correct 6 ms 5328 KB Output is correct
35 Correct 9 ms 5328 KB Output is correct
36 Correct 8 ms 5328 KB Output is correct
37 Correct 7 ms 5328 KB Output is correct
38 Correct 7 ms 5328 KB Output is correct
39 Correct 8 ms 5328 KB Output is correct
40 Correct 7 ms 5328 KB Output is correct
41 Correct 6 ms 5328 KB Output is correct
42 Correct 8 ms 5328 KB Output is correct
43 Correct 8 ms 5328 KB Output is correct
44 Correct 8 ms 5328 KB Output is correct
45 Correct 8 ms 5328 KB Output is correct
46 Correct 8 ms 5328 KB Output is correct
47 Correct 7 ms 5328 KB Output is correct
48 Correct 7 ms 5328 KB Output is correct
49 Correct 7 ms 5328 KB Output is correct
50 Correct 7 ms 5328 KB Output is correct
51 Correct 7 ms 5328 KB Output is correct
52 Correct 7 ms 5328 KB Output is correct
53 Correct 7 ms 5328 KB Output is correct
54 Correct 7 ms 5328 KB Output is correct
55 Correct 8 ms 5328 KB Output is correct
56 Correct 8 ms 5328 KB Output is correct
57 Correct 8 ms 5328 KB Output is correct
58 Correct 7 ms 5328 KB Output is correct
59 Correct 7 ms 5328 KB Output is correct
60 Correct 6 ms 5328 KB Output is correct
61 Correct 9 ms 5328 KB Output is correct
62 Correct 7 ms 5328 KB Output is correct
63 Correct 7 ms 5328 KB Output is correct
64 Correct 7 ms 5328 KB Output is correct
65 Correct 9 ms 5328 KB Output is correct
66 Correct 7 ms 5328 KB Output is correct
67 Correct 6 ms 5328 KB Output is correct
68 Correct 8 ms 5328 KB Output is correct
69 Correct 9 ms 5356 KB Output is correct
70 Correct 7 ms 5356 KB Output is correct
71 Correct 7 ms 5356 KB Output is correct
72 Correct 7 ms 5356 KB Output is correct
73 Correct 8 ms 5356 KB Output is correct
74 Correct 8 ms 5356 KB Output is correct
75 Correct 9 ms 5356 KB Output is correct
76 Correct 7 ms 5356 KB Output is correct
77 Correct 8 ms 5356 KB Output is correct
78 Correct 8 ms 5356 KB Output is correct
79 Correct 6 ms 5356 KB Output is correct
80 Correct 7 ms 5356 KB Output is correct
81 Correct 7 ms 5356 KB Output is correct
82 Correct 8 ms 5356 KB Output is correct
83 Correct 8 ms 5356 KB Output is correct
84 Correct 8 ms 5356 KB Output is correct
85 Correct 7 ms 5356 KB Output is correct
86 Correct 7 ms 5356 KB Output is correct
87 Correct 7 ms 5356 KB Output is correct
88 Correct 9 ms 5356 KB Output is correct
89 Correct 8 ms 5356 KB Output is correct
90 Correct 7 ms 5356 KB Output is correct
91 Correct 9 ms 5356 KB Output is correct
92 Correct 7 ms 5356 KB Output is correct
93 Correct 7 ms 5356 KB Output is correct
94 Correct 7 ms 5356 KB Output is correct
95 Correct 8 ms 5356 KB Output is correct
96 Correct 8 ms 5356 KB Output is correct
97 Correct 10 ms 5484 KB Output is correct
98 Correct 11 ms 5488 KB Output is correct
99 Correct 12 ms 5488 KB Output is correct
100 Correct 16 ms 5504 KB Output is correct
101 Correct 9 ms 5504 KB Output is correct
102 Correct 10 ms 5504 KB Output is correct
103 Correct 9 ms 5504 KB Output is correct
104 Correct 13 ms 5540 KB Output is correct
105 Correct 10 ms 5540 KB Output is correct
106 Correct 8 ms 5540 KB Output is correct
107 Correct 11 ms 5612 KB Output is correct
108 Correct 11 ms 5612 KB Output is correct
109 Correct 12 ms 5612 KB Output is correct
110 Correct 12 ms 5612 KB Output is correct
111 Correct 11 ms 5612 KB Output is correct
112 Correct 11 ms 5612 KB Output is correct
113 Correct 7 ms 5616 KB Output is correct
114 Correct 11 ms 5616 KB Output is correct
115 Correct 10 ms 5616 KB Output is correct
116 Correct 12 ms 5616 KB Output is correct
117 Correct 11 ms 5616 KB Output is correct
118 Correct 12 ms 5740 KB Output is correct
119 Correct 12 ms 5740 KB Output is correct
120 Correct 9 ms 5740 KB Output is correct
121 Correct 11 ms 5740 KB Output is correct
122 Correct 10 ms 5740 KB Output is correct
123 Correct 9 ms 5740 KB Output is correct
124 Correct 10 ms 5740 KB Output is correct
125 Correct 11 ms 5740 KB Output is correct
126 Correct 8 ms 5740 KB Output is correct
127 Correct 12 ms 5740 KB Output is correct
128 Correct 12 ms 5740 KB Output is correct
129 Correct 10 ms 5864 KB Output is correct
130 Correct 9 ms 5868 KB Output is correct
131 Correct 11 ms 5984 KB Output is correct
132 Correct 10 ms 5984 KB Output is correct
133 Correct 8 ms 5984 KB Output is correct
134 Correct 10 ms 5984 KB Output is correct
135 Correct 9 ms 5984 KB Output is correct
136 Correct 10 ms 5984 KB Output is correct
137 Correct 10 ms 5984 KB Output is correct
138 Correct 9 ms 5984 KB Output is correct
139 Correct 9 ms 5984 KB Output is correct
140 Correct 9 ms 5984 KB Output is correct
141 Correct 10 ms 5984 KB Output is correct
142 Correct 9 ms 5984 KB Output is correct
143 Correct 7 ms 5984 KB Output is correct
144 Correct 7 ms 5984 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 4984 KB Output is correct
2 Correct 7 ms 5092 KB Output is correct
3 Correct 7 ms 5256 KB Output is correct
4 Correct 9 ms 5256 KB Output is correct
5 Correct 7 ms 5256 KB Output is correct
6 Correct 7 ms 5256 KB Output is correct
7 Correct 8 ms 5256 KB Output is correct
8 Correct 8 ms 5256 KB Output is correct
9 Correct 8 ms 5280 KB Output is correct
10 Correct 7 ms 5280 KB Output is correct
11 Correct 7 ms 5280 KB Output is correct
12 Correct 7 ms 5280 KB Output is correct
13 Correct 5 ms 5280 KB Output is correct
14 Correct 8 ms 5280 KB Output is correct
15 Correct 8 ms 5280 KB Output is correct
16 Correct 8 ms 5280 KB Output is correct
17 Correct 8 ms 5280 KB Output is correct
18 Correct 7 ms 5280 KB Output is correct
19 Correct 9 ms 5280 KB Output is correct
20 Correct 7 ms 5280 KB Output is correct
21 Correct 7 ms 5280 KB Output is correct
22 Correct 7 ms 5280 KB Output is correct
23 Correct 8 ms 5280 KB Output is correct
24 Correct 8 ms 5280 KB Output is correct
25 Correct 9 ms 5280 KB Output is correct
26 Correct 6 ms 5280 KB Output is correct
27 Correct 8 ms 5280 KB Output is correct
28 Correct 8 ms 5280 KB Output is correct
29 Correct 6 ms 5280 KB Output is correct
30 Correct 7 ms 5280 KB Output is correct
31 Correct 7 ms 5280 KB Output is correct
32 Correct 7 ms 5328 KB Output is correct
33 Correct 8 ms 5328 KB Output is correct
34 Correct 6 ms 5328 KB Output is correct
35 Correct 9 ms 5328 KB Output is correct
36 Correct 8 ms 5328 KB Output is correct
37 Correct 7 ms 5328 KB Output is correct
38 Correct 7 ms 5328 KB Output is correct
39 Correct 8 ms 5328 KB Output is correct
40 Correct 7 ms 5328 KB Output is correct
41 Correct 6 ms 5328 KB Output is correct
42 Correct 8 ms 5328 KB Output is correct
43 Correct 8 ms 5328 KB Output is correct
44 Correct 8 ms 5328 KB Output is correct
45 Correct 8 ms 5328 KB Output is correct
46 Correct 8 ms 5328 KB Output is correct
47 Correct 7 ms 5328 KB Output is correct
48 Correct 7 ms 5328 KB Output is correct
49 Correct 7 ms 5328 KB Output is correct
50 Correct 7 ms 5328 KB Output is correct
51 Correct 7 ms 5328 KB Output is correct
52 Correct 7 ms 5328 KB Output is correct
53 Correct 7 ms 5328 KB Output is correct
54 Correct 7 ms 5328 KB Output is correct
55 Correct 8 ms 5328 KB Output is correct
56 Correct 8 ms 5328 KB Output is correct
57 Correct 8 ms 5328 KB Output is correct
58 Correct 7 ms 5328 KB Output is correct
59 Correct 7 ms 5328 KB Output is correct
60 Correct 6 ms 5328 KB Output is correct
61 Correct 9 ms 5328 KB Output is correct
62 Correct 7 ms 5328 KB Output is correct
63 Correct 7 ms 5328 KB Output is correct
64 Correct 7 ms 5328 KB Output is correct
65 Correct 9 ms 5328 KB Output is correct
66 Correct 7 ms 5328 KB Output is correct
67 Correct 6 ms 5328 KB Output is correct
68 Correct 8 ms 5328 KB Output is correct
69 Correct 9 ms 5356 KB Output is correct
70 Correct 7 ms 5356 KB Output is correct
71 Correct 7 ms 5356 KB Output is correct
72 Correct 7 ms 5356 KB Output is correct
73 Correct 8 ms 5356 KB Output is correct
74 Correct 8 ms 5356 KB Output is correct
75 Correct 9 ms 5356 KB Output is correct
76 Correct 7 ms 5356 KB Output is correct
77 Correct 8 ms 5356 KB Output is correct
78 Correct 8 ms 5356 KB Output is correct
79 Correct 6 ms 5356 KB Output is correct
80 Correct 7 ms 5356 KB Output is correct
81 Correct 7 ms 5356 KB Output is correct
82 Correct 8 ms 5356 KB Output is correct
83 Correct 8 ms 5356 KB Output is correct
84 Correct 8 ms 5356 KB Output is correct
85 Correct 7 ms 5356 KB Output is correct
86 Correct 7 ms 5356 KB Output is correct
87 Correct 7 ms 5356 KB Output is correct
88 Correct 9 ms 5356 KB Output is correct
89 Correct 8 ms 5356 KB Output is correct
90 Correct 7 ms 5356 KB Output is correct
91 Correct 9 ms 5356 KB Output is correct
92 Correct 7 ms 5356 KB Output is correct
93 Correct 7 ms 5356 KB Output is correct
94 Correct 7 ms 5356 KB Output is correct
95 Correct 8 ms 5356 KB Output is correct
96 Correct 8 ms 5356 KB Output is correct
97 Correct 10 ms 5484 KB Output is correct
98 Correct 11 ms 5488 KB Output is correct
99 Correct 12 ms 5488 KB Output is correct
100 Correct 16 ms 5504 KB Output is correct
101 Correct 9 ms 5504 KB Output is correct
102 Correct 10 ms 5504 KB Output is correct
103 Correct 9 ms 5504 KB Output is correct
104 Correct 13 ms 5540 KB Output is correct
105 Correct 10 ms 5540 KB Output is correct
106 Correct 8 ms 5540 KB Output is correct
107 Correct 11 ms 5612 KB Output is correct
108 Correct 11 ms 5612 KB Output is correct
109 Correct 12 ms 5612 KB Output is correct
110 Correct 12 ms 5612 KB Output is correct
111 Correct 11 ms 5612 KB Output is correct
112 Correct 11 ms 5612 KB Output is correct
113 Correct 7 ms 5616 KB Output is correct
114 Correct 11 ms 5616 KB Output is correct
115 Correct 10 ms 5616 KB Output is correct
116 Correct 12 ms 5616 KB Output is correct
117 Correct 11 ms 5616 KB Output is correct
118 Correct 12 ms 5740 KB Output is correct
119 Correct 12 ms 5740 KB Output is correct
120 Correct 9 ms 5740 KB Output is correct
121 Correct 11 ms 5740 KB Output is correct
122 Correct 10 ms 5740 KB Output is correct
123 Correct 9 ms 5740 KB Output is correct
124 Correct 10 ms 5740 KB Output is correct
125 Correct 11 ms 5740 KB Output is correct
126 Correct 8 ms 5740 KB Output is correct
127 Correct 12 ms 5740 KB Output is correct
128 Correct 12 ms 5740 KB Output is correct
129 Correct 10 ms 5864 KB Output is correct
130 Correct 9 ms 5868 KB Output is correct
131 Correct 11 ms 5984 KB Output is correct
132 Correct 10 ms 5984 KB Output is correct
133 Correct 8 ms 5984 KB Output is correct
134 Correct 10 ms 5984 KB Output is correct
135 Correct 9 ms 5984 KB Output is correct
136 Correct 10 ms 5984 KB Output is correct
137 Correct 10 ms 5984 KB Output is correct
138 Correct 9 ms 5984 KB Output is correct
139 Correct 9 ms 5984 KB Output is correct
140 Correct 9 ms 5984 KB Output is correct
141 Correct 10 ms 5984 KB Output is correct
142 Correct 9 ms 5984 KB Output is correct
143 Correct 7 ms 5984 KB Output is correct
144 Correct 7 ms 5984 KB Output is correct
145 Correct 258 ms 13424 KB Output is correct
146 Correct 218 ms 13424 KB Output is correct
147 Correct 258 ms 13472 KB Output is correct
148 Correct 215 ms 13472 KB Output is correct
149 Correct 227 ms 13472 KB Output is correct
150 Correct 143 ms 13472 KB Output is correct
151 Correct 144 ms 13472 KB Output is correct
152 Correct 165 ms 13472 KB Output is correct
153 Correct 178 ms 13472 KB Output is correct
154 Correct 154 ms 13472 KB Output is correct
155 Correct 213 ms 16236 KB Output is correct
156 Correct 237 ms 16304 KB Output is correct
157 Correct 220 ms 16304 KB Output is correct
158 Correct 210 ms 16364 KB Output is correct
159 Correct 237 ms 16364 KB Output is correct
160 Correct 220 ms 16364 KB Output is correct
161 Correct 231 ms 16364 KB Output is correct
162 Correct 211 ms 16364 KB Output is correct
163 Correct 252 ms 16364 KB Output is correct
164 Correct 162 ms 16364 KB Output is correct
165 Correct 168 ms 16364 KB Output is correct
166 Correct 271 ms 20224 KB Output is correct
167 Correct 313 ms 20224 KB Output is correct
168 Correct 230 ms 20224 KB Output is correct
169 Correct 229 ms 20224 KB Output is correct
170 Correct 213 ms 20224 KB Output is correct
171 Correct 252 ms 20224 KB Output is correct
172 Correct 244 ms 20224 KB Output is correct
173 Correct 237 ms 20224 KB Output is correct
174 Correct 215 ms 20224 KB Output is correct
175 Correct 209 ms 20224 KB Output is correct
176 Correct 233 ms 20224 KB Output is correct
177 Correct 309 ms 23268 KB Output is correct
178 Correct 271 ms 23300 KB Output is correct
179 Correct 277 ms 23300 KB Output is correct
180 Correct 300 ms 23300 KB Output is correct
181 Correct 76 ms 23300 KB Output is correct
182 Correct 56 ms 23300 KB Output is correct
183 Correct 187 ms 23300 KB Output is correct
184 Correct 198 ms 23300 KB Output is correct
185 Correct 138 ms 23300 KB Output is correct
186 Correct 85 ms 23300 KB Output is correct
187 Correct 49 ms 23300 KB Output is correct
188 Correct 221 ms 23300 KB Output is correct
189 Correct 151 ms 23300 KB Output is correct
190 Correct 84 ms 23300 KB Output is correct
191 Correct 48 ms 23300 KB Output is correct
192 Correct 14 ms 23300 KB Output is correct