답안 #409880

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
409880 2021-05-21T17:53:21 Z MohamedAhmed04 벽 칠하기 (APIO20_paint) C++17
100 / 100
506 ms 262772 KB
#include <bits/stdc++.h>
#include "paint.h"
//#include "grader.cpp"

using namespace std ;

const int MAX = 1e5 + 10 ;

int to[MAX] ;
int arr[MAX][633] ;

vector<int>v ;
vector<int>occ[MAX] ;

int minimumInstructions(
    int n, int m, int k, std::vector<int> C,
    std::vector<int> A, std::vector<std::vector<int>> B) 
{
	v = C ;
	for(int i = 0 ; i < m ; ++i)
	{
		for(auto &j : B[i])
			occ[j].push_back(i) ;
	}
	for(int i = 0 ; i < k ; ++i)
		sort(occ[i].begin() , occ[i].end()) ;
	for(int i = 1 ; i < n ; ++i)
	{
		to[i] = i ;
		if(!occ[v[i]].size())
			return -1 ;
		int idx = 0 ;
		for(int j = 0 ; j < occ[v[i]].size() ; ++j)
		{
			arr[i][j] = i ;
			int x = occ[v[i]][j] ;
			if(!x)
				continue ;
			int prv = x-1 ;
			while(idx < occ[v[i-1]].size() && occ[v[i-1]][idx] < prv)
				idx++ ;
			if(idx == occ[v[i-1]].size())
				continue ;
			if(occ[v[i-1]][idx] != prv)
				continue ;
			arr[i][j] = arr[i-1][idx] ;
			to[arr[i][j]] = i ;
		}
		if(occ[v[i]][0] == 0)
		{
			int prv = m-1 ;
			while(idx < occ[v[i-1]].size() && occ[v[i-1]][idx] < prv)
				idx++ ;
			if(idx == occ[v[i-1]].size())
				continue ;
			if(occ[v[i-1]][idx] != prv)
				continue ;
			arr[i][0] = arr[i-1][idx] ;
			to[arr[i][0]] = i ;
		}
	}
	if(to[0] + 1 < m)
		return -1 ;
	int ans = 1 , now = m , nxt = -1 ;
	for(int i = 1 ; i < n ; ++i)
	{
		to[i] = max(to[i] , to[i-1]) ;
		if(to[i] + 1 >= i+m)
			nxt = i+m ;
		if(i == now)
		{
			ans++ ;
			if(nxt <= i && i != n-1)
				return -1 ;
			now = nxt ;
			nxt = -1 ;
		}
	}
	return ans ;
}

Compilation message

paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:33:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |   for(int j = 0 ; j < occ[v[i]].size() ; ++j)
      |                   ~~^~~~~~~~~~~~~~~~~~
paint.cpp:40:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |    while(idx < occ[v[i-1]].size() && occ[v[i-1]][idx] < prv)
      |          ~~~~^~~~~~~~~~~~~~~~~~~~
paint.cpp:42:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |    if(idx == occ[v[i-1]].size())
      |       ~~~~^~~~~~~~~~~~~~~~~~~~~
paint.cpp:52:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   52 |    while(idx < occ[v[i-1]].size() && occ[v[i-1]][idx] < prv)
      |          ~~~~^~~~~~~~~~~~~~~~~~~~
paint.cpp:54:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   54 |    if(idx == occ[v[i-1]].size())
      |       ~~~~^~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 3 ms 3888 KB Output is correct
8 Correct 3 ms 3788 KB Output is correct
9 Correct 3 ms 3788 KB Output is correct
10 Correct 3 ms 3788 KB Output is correct
11 Correct 3 ms 3788 KB Output is correct
12 Correct 3 ms 3788 KB Output is correct
13 Correct 4 ms 3916 KB Output is correct
14 Correct 3 ms 3916 KB Output is correct
15 Correct 3 ms 3916 KB Output is correct
16 Correct 3 ms 3916 KB Output is correct
17 Correct 3 ms 3916 KB Output is correct
18 Correct 3 ms 3916 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 24 ms 8168 KB Output is correct
23 Correct 24 ms 8132 KB Output is correct
24 Correct 24 ms 8336 KB Output is correct
25 Correct 24 ms 52472 KB Output is correct
26 Correct 23 ms 52456 KB Output is correct
27 Correct 23 ms 52408 KB Output is correct
28 Correct 23 ms 52428 KB Output is correct
29 Correct 22 ms 52440 KB Output is correct
30 Correct 22 ms 52484 KB Output is correct
31 Correct 30 ms 53428 KB Output is correct
32 Correct 29 ms 53424 KB Output is correct
33 Correct 30 ms 53416 KB Output is correct
34 Correct 30 ms 53488 KB Output is correct
35 Correct 30 ms 53572 KB Output is correct
36 Correct 30 ms 53428 KB Output is correct
37 Correct 49 ms 57132 KB Output is correct
38 Correct 51 ms 57272 KB Output is correct
39 Correct 47 ms 57220 KB Output is correct
40 Correct 92 ms 228952 KB Output is correct
41 Correct 59 ms 144188 KB Output is correct
42 Correct 103 ms 248260 KB Output is correct
43 Correct 68 ms 165824 KB Output is correct
44 Correct 63 ms 150852 KB Output is correct
45 Correct 101 ms 251716 KB Output is correct
46 Correct 129 ms 227288 KB Output is correct
47 Correct 82 ms 146208 KB Output is correct
48 Correct 88 ms 149060 KB Output is correct
49 Correct 94 ms 161748 KB Output is correct
50 Correct 104 ms 184700 KB Output is correct
51 Correct 103 ms 191940 KB Output is correct
52 Correct 104 ms 252032 KB Output is correct
53 Correct 102 ms 252036 KB Output is correct
54 Correct 102 ms 252052 KB Output is correct
55 Correct 103 ms 252084 KB Output is correct
56 Correct 103 ms 252136 KB Output is correct
57 Correct 101 ms 252100 KB Output is correct
58 Correct 144 ms 262096 KB Output is correct
59 Correct 145 ms 262104 KB Output is correct
60 Correct 144 ms 262152 KB Output is correct
61 Correct 159 ms 262096 KB Output is correct
62 Correct 145 ms 262084 KB Output is correct
63 Correct 146 ms 262172 KB Output is correct
64 Correct 156 ms 261468 KB Output is correct
65 Correct 143 ms 261420 KB Output is correct
66 Correct 141 ms 261368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 3 ms 3888 KB Output is correct
8 Correct 3 ms 3788 KB Output is correct
9 Correct 3 ms 3788 KB Output is correct
10 Correct 3 ms 3788 KB Output is correct
11 Correct 3 ms 3788 KB Output is correct
12 Correct 3 ms 3788 KB Output is correct
13 Correct 4 ms 3916 KB Output is correct
14 Correct 3 ms 3916 KB Output is correct
15 Correct 3 ms 3916 KB Output is correct
16 Correct 3 ms 3916 KB Output is correct
17 Correct 3 ms 3916 KB Output is correct
18 Correct 3 ms 3916 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 2 ms 2636 KB Output is correct
25 Correct 2 ms 2636 KB Output is correct
26 Correct 2 ms 2544 KB Output is correct
27 Correct 2 ms 3276 KB Output is correct
28 Correct 3 ms 3404 KB Output is correct
29 Correct 2 ms 3276 KB Output is correct
30 Correct 3 ms 3404 KB Output is correct
31 Correct 3 ms 3660 KB Output is correct
32 Correct 2 ms 3532 KB Output is correct
33 Correct 3 ms 3660 KB Output is correct
34 Correct 3 ms 3660 KB Output is correct
35 Correct 2 ms 3404 KB Output is correct
36 Correct 3 ms 3552 KB Output is correct
37 Correct 3 ms 3404 KB Output is correct
38 Correct 2 ms 2636 KB Output is correct
39 Correct 2 ms 3404 KB Output is correct
40 Correct 2 ms 2636 KB Output is correct
41 Correct 2 ms 3404 KB Output is correct
42 Correct 2 ms 2636 KB Output is correct
43 Correct 2 ms 3404 KB Output is correct
44 Correct 3 ms 3788 KB Output is correct
45 Correct 3 ms 3788 KB Output is correct
46 Correct 3 ms 3788 KB Output is correct
47 Correct 3 ms 3788 KB Output is correct
48 Correct 3 ms 3800 KB Output is correct
49 Correct 3 ms 3788 KB Output is correct
50 Correct 3 ms 3916 KB Output is correct
51 Correct 3 ms 3916 KB Output is correct
52 Correct 3 ms 3916 KB Output is correct
53 Correct 3 ms 3916 KB Output is correct
54 Correct 3 ms 3916 KB Output is correct
55 Correct 3 ms 3916 KB Output is correct
56 Correct 2 ms 2636 KB Output is correct
57 Correct 3 ms 3916 KB Output is correct
58 Correct 2 ms 2636 KB Output is correct
59 Correct 3 ms 3916 KB Output is correct
60 Correct 3 ms 2636 KB Output is correct
61 Correct 3 ms 3828 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 3 ms 3888 KB Output is correct
10 Correct 3 ms 3788 KB Output is correct
11 Correct 3 ms 3788 KB Output is correct
12 Correct 3 ms 3788 KB Output is correct
13 Correct 3 ms 3788 KB Output is correct
14 Correct 3 ms 3788 KB Output is correct
15 Correct 4 ms 3916 KB Output is correct
16 Correct 3 ms 3916 KB Output is correct
17 Correct 3 ms 3916 KB Output is correct
18 Correct 3 ms 3916 KB Output is correct
19 Correct 3 ms 3916 KB Output is correct
20 Correct 3 ms 3916 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 24 ms 8168 KB Output is correct
25 Correct 24 ms 8132 KB Output is correct
26 Correct 24 ms 8336 KB Output is correct
27 Correct 2 ms 2636 KB Output is correct
28 Correct 2 ms 2636 KB Output is correct
29 Correct 2 ms 2544 KB Output is correct
30 Correct 2 ms 3276 KB Output is correct
31 Correct 3 ms 3404 KB Output is correct
32 Correct 2 ms 3276 KB Output is correct
33 Correct 3 ms 3404 KB Output is correct
34 Correct 3 ms 3660 KB Output is correct
35 Correct 2 ms 3532 KB Output is correct
36 Correct 3 ms 3660 KB Output is correct
37 Correct 3 ms 3660 KB Output is correct
38 Correct 2 ms 3404 KB Output is correct
39 Correct 3 ms 3552 KB Output is correct
40 Correct 3 ms 3404 KB Output is correct
41 Correct 2 ms 2636 KB Output is correct
42 Correct 2 ms 3404 KB Output is correct
43 Correct 2 ms 2636 KB Output is correct
44 Correct 2 ms 3404 KB Output is correct
45 Correct 2 ms 2636 KB Output is correct
46 Correct 2 ms 3404 KB Output is correct
47 Correct 3 ms 3788 KB Output is correct
48 Correct 3 ms 3788 KB Output is correct
49 Correct 3 ms 3788 KB Output is correct
50 Correct 3 ms 3788 KB Output is correct
51 Correct 3 ms 3800 KB Output is correct
52 Correct 3 ms 3788 KB Output is correct
53 Correct 3 ms 3916 KB Output is correct
54 Correct 3 ms 3916 KB Output is correct
55 Correct 3 ms 3916 KB Output is correct
56 Correct 3 ms 3916 KB Output is correct
57 Correct 3 ms 3916 KB Output is correct
58 Correct 3 ms 3916 KB Output is correct
59 Correct 2 ms 2636 KB Output is correct
60 Correct 3 ms 3916 KB Output is correct
61 Correct 2 ms 2636 KB Output is correct
62 Correct 3 ms 3916 KB Output is correct
63 Correct 3 ms 2636 KB Output is correct
64 Correct 3 ms 3828 KB Output is correct
65 Correct 3 ms 3276 KB Output is correct
66 Correct 3 ms 3788 KB Output is correct
67 Correct 3 ms 3788 KB Output is correct
68 Correct 3 ms 3788 KB Output is correct
69 Correct 3 ms 3788 KB Output is correct
70 Correct 5 ms 3916 KB Output is correct
71 Correct 5 ms 3788 KB Output is correct
72 Correct 4 ms 3788 KB Output is correct
73 Correct 4 ms 3660 KB Output is correct
74 Correct 4 ms 3660 KB Output is correct
75 Correct 4 ms 3660 KB Output is correct
76 Correct 25 ms 5232 KB Output is correct
77 Correct 23 ms 5740 KB Output is correct
78 Correct 29 ms 6180 KB Output is correct
79 Correct 3 ms 3916 KB Output is correct
80 Correct 3 ms 3916 KB Output is correct
81 Correct 5 ms 3916 KB Output is correct
82 Correct 4 ms 3916 KB Output is correct
83 Correct 3 ms 3916 KB Output is correct
84 Correct 5 ms 4044 KB Output is correct
85 Correct 5 ms 4108 KB Output is correct
86 Correct 5 ms 4044 KB Output is correct
87 Correct 5 ms 4044 KB Output is correct
88 Correct 5 ms 4044 KB Output is correct
89 Correct 5 ms 4044 KB Output is correct
90 Correct 33 ms 6416 KB Output is correct
91 Correct 46 ms 6384 KB Output is correct
92 Correct 38 ms 6416 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 3 ms 3888 KB Output is correct
10 Correct 3 ms 3788 KB Output is correct
11 Correct 3 ms 3788 KB Output is correct
12 Correct 3 ms 3788 KB Output is correct
13 Correct 3 ms 3788 KB Output is correct
14 Correct 3 ms 3788 KB Output is correct
15 Correct 4 ms 3916 KB Output is correct
16 Correct 3 ms 3916 KB Output is correct
17 Correct 3 ms 3916 KB Output is correct
18 Correct 3 ms 3916 KB Output is correct
19 Correct 3 ms 3916 KB Output is correct
20 Correct 3 ms 3916 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 24 ms 8168 KB Output is correct
25 Correct 24 ms 8132 KB Output is correct
26 Correct 24 ms 8336 KB Output is correct
27 Correct 24 ms 52472 KB Output is correct
28 Correct 23 ms 52456 KB Output is correct
29 Correct 23 ms 52408 KB Output is correct
30 Correct 23 ms 52428 KB Output is correct
31 Correct 22 ms 52440 KB Output is correct
32 Correct 22 ms 52484 KB Output is correct
33 Correct 30 ms 53428 KB Output is correct
34 Correct 29 ms 53424 KB Output is correct
35 Correct 30 ms 53416 KB Output is correct
36 Correct 30 ms 53488 KB Output is correct
37 Correct 30 ms 53572 KB Output is correct
38 Correct 30 ms 53428 KB Output is correct
39 Correct 49 ms 57132 KB Output is correct
40 Correct 51 ms 57272 KB Output is correct
41 Correct 47 ms 57220 KB Output is correct
42 Correct 2 ms 2636 KB Output is correct
43 Correct 2 ms 2636 KB Output is correct
44 Correct 2 ms 2544 KB Output is correct
45 Correct 2 ms 3276 KB Output is correct
46 Correct 3 ms 3404 KB Output is correct
47 Correct 2 ms 3276 KB Output is correct
48 Correct 3 ms 3404 KB Output is correct
49 Correct 3 ms 3660 KB Output is correct
50 Correct 2 ms 3532 KB Output is correct
51 Correct 3 ms 3660 KB Output is correct
52 Correct 3 ms 3660 KB Output is correct
53 Correct 2 ms 3404 KB Output is correct
54 Correct 3 ms 3552 KB Output is correct
55 Correct 3 ms 3404 KB Output is correct
56 Correct 2 ms 2636 KB Output is correct
57 Correct 2 ms 3404 KB Output is correct
58 Correct 2 ms 2636 KB Output is correct
59 Correct 2 ms 3404 KB Output is correct
60 Correct 2 ms 2636 KB Output is correct
61 Correct 2 ms 3404 KB Output is correct
62 Correct 3 ms 3788 KB Output is correct
63 Correct 3 ms 3788 KB Output is correct
64 Correct 3 ms 3788 KB Output is correct
65 Correct 3 ms 3788 KB Output is correct
66 Correct 3 ms 3800 KB Output is correct
67 Correct 3 ms 3788 KB Output is correct
68 Correct 3 ms 3916 KB Output is correct
69 Correct 3 ms 3916 KB Output is correct
70 Correct 3 ms 3916 KB Output is correct
71 Correct 3 ms 3916 KB Output is correct
72 Correct 3 ms 3916 KB Output is correct
73 Correct 3 ms 3916 KB Output is correct
74 Correct 2 ms 2636 KB Output is correct
75 Correct 3 ms 3916 KB Output is correct
76 Correct 2 ms 2636 KB Output is correct
77 Correct 3 ms 3916 KB Output is correct
78 Correct 3 ms 2636 KB Output is correct
79 Correct 3 ms 3828 KB Output is correct
80 Correct 3 ms 3276 KB Output is correct
81 Correct 3 ms 3788 KB Output is correct
82 Correct 3 ms 3788 KB Output is correct
83 Correct 3 ms 3788 KB Output is correct
84 Correct 3 ms 3788 KB Output is correct
85 Correct 5 ms 3916 KB Output is correct
86 Correct 5 ms 3788 KB Output is correct
87 Correct 4 ms 3788 KB Output is correct
88 Correct 4 ms 3660 KB Output is correct
89 Correct 4 ms 3660 KB Output is correct
90 Correct 4 ms 3660 KB Output is correct
91 Correct 25 ms 5232 KB Output is correct
92 Correct 23 ms 5740 KB Output is correct
93 Correct 29 ms 6180 KB Output is correct
94 Correct 3 ms 3916 KB Output is correct
95 Correct 3 ms 3916 KB Output is correct
96 Correct 5 ms 3916 KB Output is correct
97 Correct 4 ms 3916 KB Output is correct
98 Correct 3 ms 3916 KB Output is correct
99 Correct 5 ms 4044 KB Output is correct
100 Correct 5 ms 4108 KB Output is correct
101 Correct 5 ms 4044 KB Output is correct
102 Correct 5 ms 4044 KB Output is correct
103 Correct 5 ms 4044 KB Output is correct
104 Correct 5 ms 4044 KB Output is correct
105 Correct 33 ms 6416 KB Output is correct
106 Correct 46 ms 6384 KB Output is correct
107 Correct 38 ms 6416 KB Output is correct
108 Correct 26 ms 52168 KB Output is correct
109 Correct 76 ms 38796 KB Output is correct
110 Correct 51 ms 33352 KB Output is correct
111 Correct 46 ms 31464 KB Output is correct
112 Correct 58 ms 41036 KB Output is correct
113 Correct 43 ms 29628 KB Output is correct
114 Correct 28 ms 31704 KB Output is correct
115 Correct 26 ms 29064 KB Output is correct
116 Correct 37 ms 49604 KB Output is correct
117 Correct 26 ms 31064 KB Output is correct
118 Correct 29 ms 35624 KB Output is correct
119 Correct 30 ms 39496 KB Output is correct
120 Correct 25 ms 5700 KB Output is correct
121 Correct 18 ms 32608 KB Output is correct
122 Correct 27 ms 6092 KB Output is correct
123 Correct 18 ms 31640 KB Output is correct
124 Correct 31 ms 6600 KB Output is correct
125 Correct 27 ms 49868 KB Output is correct
126 Correct 24 ms 42144 KB Output is correct
127 Correct 29 ms 49860 KB Output is correct
128 Correct 22 ms 37044 KB Output is correct
129 Correct 27 ms 38380 KB Output is correct
130 Correct 23 ms 52560 KB Output is correct
131 Correct 105 ms 52592 KB Output is correct
132 Correct 100 ms 52552 KB Output is correct
133 Correct 88 ms 52548 KB Output is correct
134 Correct 87 ms 52676 KB Output is correct
135 Correct 88 ms 52648 KB Output is correct
136 Correct 43 ms 54408 KB Output is correct
137 Correct 42 ms 54396 KB Output is correct
138 Correct 42 ms 54476 KB Output is correct
139 Correct 44 ms 54440 KB Output is correct
140 Correct 42 ms 54428 KB Output is correct
141 Correct 42 ms 54388 KB Output is correct
142 Correct 45 ms 7784 KB Output is correct
143 Correct 32 ms 53452 KB Output is correct
144 Correct 40 ms 7784 KB Output is correct
145 Correct 29 ms 53352 KB Output is correct
146 Correct 39 ms 7772 KB Output is correct
147 Correct 30 ms 53380 KB Output is correct
148 Correct 32 ms 53836 KB Output is correct
149 Correct 32 ms 53700 KB Output is correct
150 Correct 37 ms 53688 KB Output is correct
151 Correct 39 ms 53572 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 3 ms 3888 KB Output is correct
10 Correct 3 ms 3788 KB Output is correct
11 Correct 3 ms 3788 KB Output is correct
12 Correct 3 ms 3788 KB Output is correct
13 Correct 3 ms 3788 KB Output is correct
14 Correct 3 ms 3788 KB Output is correct
15 Correct 4 ms 3916 KB Output is correct
16 Correct 3 ms 3916 KB Output is correct
17 Correct 3 ms 3916 KB Output is correct
18 Correct 3 ms 3916 KB Output is correct
19 Correct 3 ms 3916 KB Output is correct
20 Correct 3 ms 3916 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 24 ms 8168 KB Output is correct
25 Correct 24 ms 8132 KB Output is correct
26 Correct 24 ms 8336 KB Output is correct
27 Correct 24 ms 52472 KB Output is correct
28 Correct 23 ms 52456 KB Output is correct
29 Correct 23 ms 52408 KB Output is correct
30 Correct 23 ms 52428 KB Output is correct
31 Correct 22 ms 52440 KB Output is correct
32 Correct 22 ms 52484 KB Output is correct
33 Correct 30 ms 53428 KB Output is correct
34 Correct 29 ms 53424 KB Output is correct
35 Correct 30 ms 53416 KB Output is correct
36 Correct 30 ms 53488 KB Output is correct
37 Correct 30 ms 53572 KB Output is correct
38 Correct 30 ms 53428 KB Output is correct
39 Correct 49 ms 57132 KB Output is correct
40 Correct 51 ms 57272 KB Output is correct
41 Correct 47 ms 57220 KB Output is correct
42 Correct 92 ms 228952 KB Output is correct
43 Correct 59 ms 144188 KB Output is correct
44 Correct 103 ms 248260 KB Output is correct
45 Correct 68 ms 165824 KB Output is correct
46 Correct 63 ms 150852 KB Output is correct
47 Correct 101 ms 251716 KB Output is correct
48 Correct 129 ms 227288 KB Output is correct
49 Correct 82 ms 146208 KB Output is correct
50 Correct 88 ms 149060 KB Output is correct
51 Correct 94 ms 161748 KB Output is correct
52 Correct 104 ms 184700 KB Output is correct
53 Correct 103 ms 191940 KB Output is correct
54 Correct 104 ms 252032 KB Output is correct
55 Correct 102 ms 252036 KB Output is correct
56 Correct 102 ms 252052 KB Output is correct
57 Correct 103 ms 252084 KB Output is correct
58 Correct 103 ms 252136 KB Output is correct
59 Correct 101 ms 252100 KB Output is correct
60 Correct 144 ms 262096 KB Output is correct
61 Correct 145 ms 262104 KB Output is correct
62 Correct 144 ms 262152 KB Output is correct
63 Correct 159 ms 262096 KB Output is correct
64 Correct 145 ms 262084 KB Output is correct
65 Correct 146 ms 262172 KB Output is correct
66 Correct 156 ms 261468 KB Output is correct
67 Correct 143 ms 261420 KB Output is correct
68 Correct 141 ms 261368 KB Output is correct
69 Correct 2 ms 2636 KB Output is correct
70 Correct 2 ms 2636 KB Output is correct
71 Correct 2 ms 2544 KB Output is correct
72 Correct 2 ms 3276 KB Output is correct
73 Correct 3 ms 3404 KB Output is correct
74 Correct 2 ms 3276 KB Output is correct
75 Correct 3 ms 3404 KB Output is correct
76 Correct 3 ms 3660 KB Output is correct
77 Correct 2 ms 3532 KB Output is correct
78 Correct 3 ms 3660 KB Output is correct
79 Correct 3 ms 3660 KB Output is correct
80 Correct 2 ms 3404 KB Output is correct
81 Correct 3 ms 3552 KB Output is correct
82 Correct 3 ms 3404 KB Output is correct
83 Correct 2 ms 2636 KB Output is correct
84 Correct 2 ms 3404 KB Output is correct
85 Correct 2 ms 2636 KB Output is correct
86 Correct 2 ms 3404 KB Output is correct
87 Correct 2 ms 2636 KB Output is correct
88 Correct 2 ms 3404 KB Output is correct
89 Correct 3 ms 3788 KB Output is correct
90 Correct 3 ms 3788 KB Output is correct
91 Correct 3 ms 3788 KB Output is correct
92 Correct 3 ms 3788 KB Output is correct
93 Correct 3 ms 3800 KB Output is correct
94 Correct 3 ms 3788 KB Output is correct
95 Correct 3 ms 3916 KB Output is correct
96 Correct 3 ms 3916 KB Output is correct
97 Correct 3 ms 3916 KB Output is correct
98 Correct 3 ms 3916 KB Output is correct
99 Correct 3 ms 3916 KB Output is correct
100 Correct 3 ms 3916 KB Output is correct
101 Correct 2 ms 2636 KB Output is correct
102 Correct 3 ms 3916 KB Output is correct
103 Correct 2 ms 2636 KB Output is correct
104 Correct 3 ms 3916 KB Output is correct
105 Correct 3 ms 2636 KB Output is correct
106 Correct 3 ms 3828 KB Output is correct
107 Correct 3 ms 3276 KB Output is correct
108 Correct 3 ms 3788 KB Output is correct
109 Correct 3 ms 3788 KB Output is correct
110 Correct 3 ms 3788 KB Output is correct
111 Correct 3 ms 3788 KB Output is correct
112 Correct 5 ms 3916 KB Output is correct
113 Correct 5 ms 3788 KB Output is correct
114 Correct 4 ms 3788 KB Output is correct
115 Correct 4 ms 3660 KB Output is correct
116 Correct 4 ms 3660 KB Output is correct
117 Correct 4 ms 3660 KB Output is correct
118 Correct 25 ms 5232 KB Output is correct
119 Correct 23 ms 5740 KB Output is correct
120 Correct 29 ms 6180 KB Output is correct
121 Correct 3 ms 3916 KB Output is correct
122 Correct 3 ms 3916 KB Output is correct
123 Correct 5 ms 3916 KB Output is correct
124 Correct 4 ms 3916 KB Output is correct
125 Correct 3 ms 3916 KB Output is correct
126 Correct 5 ms 4044 KB Output is correct
127 Correct 5 ms 4108 KB Output is correct
128 Correct 5 ms 4044 KB Output is correct
129 Correct 5 ms 4044 KB Output is correct
130 Correct 5 ms 4044 KB Output is correct
131 Correct 5 ms 4044 KB Output is correct
132 Correct 33 ms 6416 KB Output is correct
133 Correct 46 ms 6384 KB Output is correct
134 Correct 38 ms 6416 KB Output is correct
135 Correct 26 ms 52168 KB Output is correct
136 Correct 76 ms 38796 KB Output is correct
137 Correct 51 ms 33352 KB Output is correct
138 Correct 46 ms 31464 KB Output is correct
139 Correct 58 ms 41036 KB Output is correct
140 Correct 43 ms 29628 KB Output is correct
141 Correct 28 ms 31704 KB Output is correct
142 Correct 26 ms 29064 KB Output is correct
143 Correct 37 ms 49604 KB Output is correct
144 Correct 26 ms 31064 KB Output is correct
145 Correct 29 ms 35624 KB Output is correct
146 Correct 30 ms 39496 KB Output is correct
147 Correct 25 ms 5700 KB Output is correct
148 Correct 18 ms 32608 KB Output is correct
149 Correct 27 ms 6092 KB Output is correct
150 Correct 18 ms 31640 KB Output is correct
151 Correct 31 ms 6600 KB Output is correct
152 Correct 27 ms 49868 KB Output is correct
153 Correct 24 ms 42144 KB Output is correct
154 Correct 29 ms 49860 KB Output is correct
155 Correct 22 ms 37044 KB Output is correct
156 Correct 27 ms 38380 KB Output is correct
157 Correct 23 ms 52560 KB Output is correct
158 Correct 105 ms 52592 KB Output is correct
159 Correct 100 ms 52552 KB Output is correct
160 Correct 88 ms 52548 KB Output is correct
161 Correct 87 ms 52676 KB Output is correct
162 Correct 88 ms 52648 KB Output is correct
163 Correct 43 ms 54408 KB Output is correct
164 Correct 42 ms 54396 KB Output is correct
165 Correct 42 ms 54476 KB Output is correct
166 Correct 44 ms 54440 KB Output is correct
167 Correct 42 ms 54428 KB Output is correct
168 Correct 42 ms 54388 KB Output is correct
169 Correct 45 ms 7784 KB Output is correct
170 Correct 32 ms 53452 KB Output is correct
171 Correct 40 ms 7784 KB Output is correct
172 Correct 29 ms 53352 KB Output is correct
173 Correct 39 ms 7772 KB Output is correct
174 Correct 30 ms 53380 KB Output is correct
175 Correct 32 ms 53836 KB Output is correct
176 Correct 32 ms 53700 KB Output is correct
177 Correct 37 ms 53688 KB Output is correct
178 Correct 39 ms 53572 KB Output is correct
179 Correct 67 ms 157352 KB Output is correct
180 Correct 223 ms 132460 KB Output is correct
181 Correct 281 ms 190464 KB Output is correct
182 Correct 410 ms 249888 KB Output is correct
183 Correct 235 ms 165188 KB Output is correct
184 Correct 219 ms 158396 KB Output is correct
185 Correct 81 ms 135168 KB Output is correct
186 Correct 91 ms 166348 KB Output is correct
187 Correct 95 ms 159588 KB Output is correct
188 Correct 45 ms 7544 KB Output is correct
189 Correct 121 ms 225432 KB Output is correct
190 Correct 38 ms 8580 KB Output is correct
191 Correct 108 ms 200700 KB Output is correct
192 Correct 28 ms 6708 KB Output is correct
193 Correct 87 ms 170052 KB Output is correct
194 Correct 101 ms 252116 KB Output is correct
195 Correct 506 ms 252216 KB Output is correct
196 Correct 434 ms 252228 KB Output is correct
197 Correct 419 ms 252216 KB Output is correct
198 Correct 447 ms 252272 KB Output is correct
199 Correct 404 ms 252232 KB Output is correct
200 Correct 171 ms 262744 KB Output is correct
201 Correct 179 ms 262724 KB Output is correct
202 Correct 165 ms 262772 KB Output is correct
203 Correct 166 ms 262668 KB Output is correct
204 Correct 165 ms 262728 KB Output is correct
205 Correct 164 ms 262740 KB Output is correct
206 Correct 61 ms 13516 KB Output is correct
207 Correct 146 ms 260956 KB Output is correct
208 Correct 60 ms 13508 KB Output is correct
209 Correct 148 ms 261120 KB Output is correct
210 Correct 62 ms 13508 KB Output is correct
211 Correct 148 ms 261056 KB Output is correct
212 Correct 156 ms 262452 KB Output is correct
213 Correct 155 ms 259660 KB Output is correct
214 Correct 148 ms 259028 KB Output is correct
215 Correct 154 ms 258884 KB Output is correct