답안 #434699

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
434699 2021-06-21T15:07:44 Z dqhungdl 벽 칠하기 (APIO20_paint) C++17
100 / 100
868 ms 506324 KB
#include "paint.h"

#include <bits/stdc++.h>
using namespace std;

const int MAX=1e5+5;
vector<int> companies[MAX],g[MAX],f[MAX];

int minimumInstructions(
    int N, int M, int K, std::vector<int> C,
    std::vector<int> A, std::vector<std::vector<int>> B) {
	for(int i=0;i<M;i++)
		for(int j=0;j<A[i];j++)
			companies[B[i][j]].push_back(i);
	for(int i=0;i<N;i++) {
		g[i]=companies[C[i]];
		f[i].resize(g[i].size());
	}
	vector<bool> canStart(N);
	for(int i=0;i<g[N-1].size();i++)
		f[N-1][i]=N-1;
	for(int i=N-2;i>=0;i--) {
		int cur=0;
		for(int j=0;j<g[i].size();j++) {
			int nextValue=(g[i][j]+1)%M;
			if(nextValue==0)
				f[i][j]=(g[i+1].size()>0&&g[i+1][0]==0?f[i+1][0]:i);
			else {
				while(cur<g[i+1].size()&&g[i+1][cur]<nextValue)
					cur++;
				if(cur<g[i+1].size()&&g[i+1][cur]==nextValue)
					f[i][j]=f[i+1][cur];
				else
					f[i][j]=i;
			}
		}
	}
	for(int i=0;i<N;i++)
		for(int j=0;j<g[i].size();j++)
			if(f[i][j]-i+1>=M)
				canStart[i]=true;
	int cur=-1,lastPos=0,rs=0;
	while(lastPos<N) {
		int found=-1;
		for(int i=lastPos;i>cur;i--)
			if(canStart[i]) {
				found=i;
				break;
			}
		if(found==-1)
			return -1;
		lastPos=found+M;
		cur=found;
		rs++;
	}
	return rs;
}

Compilation message

paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:20:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  for(int i=0;i<g[N-1].size();i++)
      |              ~^~~~~~~~~~~~~~
paint.cpp:24:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   for(int j=0;j<g[i].size();j++) {
      |               ~^~~~~~~~~~~~
paint.cpp:29:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     while(cur<g[i+1].size()&&g[i+1][cur]<nextValue)
      |           ~~~^~~~~~~~~~~~~~
paint.cpp:31:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     if(cur<g[i+1].size()&&g[i+1][cur]==nextValue)
      |        ~~~^~~~~~~~~~~~~~
paint.cpp:39:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |   for(int j=0;j<g[i].size();j++)
      |               ~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 7244 KB Output is correct
2 Correct 5 ms 7244 KB Output is correct
3 Correct 5 ms 7336 KB Output is correct
4 Correct 5 ms 7244 KB Output is correct
5 Correct 4 ms 7244 KB Output is correct
6 Correct 5 ms 7244 KB Output is correct
7 Correct 5 ms 7372 KB Output is correct
8 Correct 5 ms 7292 KB Output is correct
9 Correct 5 ms 7372 KB Output is correct
10 Correct 5 ms 7372 KB Output is correct
11 Correct 5 ms 7372 KB Output is correct
12 Correct 5 ms 7372 KB Output is correct
13 Correct 5 ms 7412 KB Output is correct
14 Correct 5 ms 7372 KB Output is correct
15 Correct 5 ms 7372 KB Output is correct
16 Correct 5 ms 7372 KB Output is correct
17 Correct 6 ms 7372 KB Output is correct
18 Correct 7 ms 7372 KB Output is correct
19 Correct 5 ms 7372 KB Output is correct
20 Correct 5 ms 7372 KB Output is correct
21 Correct 5 ms 7396 KB Output is correct
22 Correct 27 ms 11284 KB Output is correct
23 Correct 29 ms 11288 KB Output is correct
24 Correct 28 ms 11188 KB Output is correct
25 Correct 9 ms 8652 KB Output is correct
26 Correct 10 ms 8652 KB Output is correct
27 Correct 9 ms 8684 KB Output is correct
28 Correct 9 ms 8652 KB Output is correct
29 Correct 9 ms 8696 KB Output is correct
30 Correct 11 ms 8652 KB Output is correct
31 Correct 19 ms 9548 KB Output is correct
32 Correct 17 ms 9596 KB Output is correct
33 Correct 23 ms 9536 KB Output is correct
34 Correct 19 ms 9600 KB Output is correct
35 Correct 16 ms 9608 KB Output is correct
36 Correct 16 ms 9648 KB Output is correct
37 Correct 35 ms 12764 KB Output is correct
38 Correct 37 ms 12800 KB Output is correct
39 Correct 40 ms 12736 KB Output is correct
40 Correct 28 ms 13720 KB Output is correct
41 Correct 18 ms 11256 KB Output is correct
42 Correct 29 ms 14184 KB Output is correct
43 Correct 20 ms 11864 KB Output is correct
44 Correct 20 ms 11468 KB Output is correct
45 Correct 28 ms 14380 KB Output is correct
46 Correct 67 ms 21760 KB Output is correct
47 Correct 41 ms 15816 KB Output is correct
48 Correct 45 ms 18308 KB Output is correct
49 Correct 57 ms 18744 KB Output is correct
50 Correct 72 ms 19032 KB Output is correct
51 Correct 52 ms 17004 KB Output is correct
52 Correct 27 ms 14260 KB Output is correct
53 Correct 26 ms 14284 KB Output is correct
54 Correct 28 ms 14280 KB Output is correct
55 Correct 28 ms 14280 KB Output is correct
56 Correct 28 ms 14308 KB Output is correct
57 Correct 29 ms 14284 KB Output is correct
58 Correct 80 ms 23316 KB Output is correct
59 Correct 81 ms 23364 KB Output is correct
60 Correct 74 ms 23352 KB Output is correct
61 Correct 74 ms 23312 KB Output is correct
62 Correct 91 ms 23372 KB Output is correct
63 Correct 73 ms 23364 KB Output is correct
64 Correct 77 ms 22508 KB Output is correct
65 Correct 94 ms 22592 KB Output is correct
66 Correct 91 ms 22528 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 7244 KB Output is correct
2 Correct 5 ms 7244 KB Output is correct
3 Correct 5 ms 7336 KB Output is correct
4 Correct 5 ms 7244 KB Output is correct
5 Correct 4 ms 7244 KB Output is correct
6 Correct 5 ms 7244 KB Output is correct
7 Correct 5 ms 7372 KB Output is correct
8 Correct 5 ms 7292 KB Output is correct
9 Correct 5 ms 7372 KB Output is correct
10 Correct 5 ms 7372 KB Output is correct
11 Correct 5 ms 7372 KB Output is correct
12 Correct 5 ms 7372 KB Output is correct
13 Correct 5 ms 7412 KB Output is correct
14 Correct 5 ms 7372 KB Output is correct
15 Correct 5 ms 7372 KB Output is correct
16 Correct 5 ms 7372 KB Output is correct
17 Correct 6 ms 7372 KB Output is correct
18 Correct 7 ms 7372 KB Output is correct
19 Correct 5 ms 7372 KB Output is correct
20 Correct 5 ms 7372 KB Output is correct
21 Correct 5 ms 7396 KB Output is correct
22 Correct 6 ms 7244 KB Output is correct
23 Correct 5 ms 7240 KB Output is correct
24 Correct 5 ms 7336 KB Output is correct
25 Correct 5 ms 7244 KB Output is correct
26 Correct 6 ms 7244 KB Output is correct
27 Correct 5 ms 7244 KB Output is correct
28 Correct 5 ms 7372 KB Output is correct
29 Correct 5 ms 7372 KB Output is correct
30 Correct 6 ms 7500 KB Output is correct
31 Correct 5 ms 7372 KB Output is correct
32 Correct 5 ms 7372 KB Output is correct
33 Correct 5 ms 7372 KB Output is correct
34 Correct 5 ms 7372 KB Output is correct
35 Correct 5 ms 7372 KB Output is correct
36 Correct 5 ms 7372 KB Output is correct
37 Correct 5 ms 7388 KB Output is correct
38 Correct 5 ms 7372 KB Output is correct
39 Correct 5 ms 7372 KB Output is correct
40 Correct 5 ms 7372 KB Output is correct
41 Correct 5 ms 7332 KB Output is correct
42 Correct 5 ms 7372 KB Output is correct
43 Correct 7 ms 7372 KB Output is correct
44 Correct 6 ms 7376 KB Output is correct
45 Correct 5 ms 7372 KB Output is correct
46 Correct 5 ms 7372 KB Output is correct
47 Correct 5 ms 7372 KB Output is correct
48 Correct 5 ms 7372 KB Output is correct
49 Correct 5 ms 7408 KB Output is correct
50 Correct 5 ms 7372 KB Output is correct
51 Correct 5 ms 7372 KB Output is correct
52 Correct 5 ms 7372 KB Output is correct
53 Correct 6 ms 7372 KB Output is correct
54 Correct 5 ms 7372 KB Output is correct
55 Correct 7 ms 7372 KB Output is correct
56 Correct 5 ms 7316 KB Output is correct
57 Correct 5 ms 7372 KB Output is correct
58 Correct 7 ms 7300 KB Output is correct
59 Correct 5 ms 7372 KB Output is correct
60 Correct 7 ms 7372 KB Output is correct
61 Correct 5 ms 7372 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 7244 KB Output is correct
2 Correct 5 ms 7240 KB Output is correct
3 Correct 5 ms 7244 KB Output is correct
4 Correct 5 ms 7244 KB Output is correct
5 Correct 5 ms 7336 KB Output is correct
6 Correct 5 ms 7244 KB Output is correct
7 Correct 4 ms 7244 KB Output is correct
8 Correct 5 ms 7244 KB Output is correct
9 Correct 5 ms 7372 KB Output is correct
10 Correct 5 ms 7292 KB Output is correct
11 Correct 5 ms 7372 KB Output is correct
12 Correct 5 ms 7372 KB Output is correct
13 Correct 5 ms 7372 KB Output is correct
14 Correct 5 ms 7372 KB Output is correct
15 Correct 5 ms 7412 KB Output is correct
16 Correct 5 ms 7372 KB Output is correct
17 Correct 5 ms 7372 KB Output is correct
18 Correct 5 ms 7372 KB Output is correct
19 Correct 6 ms 7372 KB Output is correct
20 Correct 7 ms 7372 KB Output is correct
21 Correct 5 ms 7372 KB Output is correct
22 Correct 5 ms 7372 KB Output is correct
23 Correct 5 ms 7396 KB Output is correct
24 Correct 27 ms 11284 KB Output is correct
25 Correct 29 ms 11288 KB Output is correct
26 Correct 28 ms 11188 KB Output is correct
27 Correct 5 ms 7336 KB Output is correct
28 Correct 5 ms 7244 KB Output is correct
29 Correct 6 ms 7244 KB Output is correct
30 Correct 5 ms 7244 KB Output is correct
31 Correct 5 ms 7372 KB Output is correct
32 Correct 5 ms 7372 KB Output is correct
33 Correct 6 ms 7500 KB Output is correct
34 Correct 5 ms 7372 KB Output is correct
35 Correct 5 ms 7372 KB Output is correct
36 Correct 5 ms 7372 KB Output is correct
37 Correct 5 ms 7372 KB Output is correct
38 Correct 5 ms 7372 KB Output is correct
39 Correct 5 ms 7372 KB Output is correct
40 Correct 5 ms 7388 KB Output is correct
41 Correct 5 ms 7372 KB Output is correct
42 Correct 5 ms 7372 KB Output is correct
43 Correct 5 ms 7372 KB Output is correct
44 Correct 5 ms 7332 KB Output is correct
45 Correct 5 ms 7372 KB Output is correct
46 Correct 7 ms 7372 KB Output is correct
47 Correct 6 ms 7376 KB Output is correct
48 Correct 5 ms 7372 KB Output is correct
49 Correct 5 ms 7372 KB Output is correct
50 Correct 5 ms 7372 KB Output is correct
51 Correct 5 ms 7372 KB Output is correct
52 Correct 5 ms 7408 KB Output is correct
53 Correct 5 ms 7372 KB Output is correct
54 Correct 5 ms 7372 KB Output is correct
55 Correct 5 ms 7372 KB Output is correct
56 Correct 6 ms 7372 KB Output is correct
57 Correct 5 ms 7372 KB Output is correct
58 Correct 7 ms 7372 KB Output is correct
59 Correct 5 ms 7316 KB Output is correct
60 Correct 5 ms 7372 KB Output is correct
61 Correct 7 ms 7300 KB Output is correct
62 Correct 5 ms 7372 KB Output is correct
63 Correct 7 ms 7372 KB Output is correct
64 Correct 5 ms 7372 KB Output is correct
65 Correct 6 ms 7628 KB Output is correct
66 Correct 5 ms 7500 KB Output is correct
67 Correct 6 ms 7756 KB Output is correct
68 Correct 6 ms 7628 KB Output is correct
69 Correct 6 ms 7756 KB Output is correct
70 Correct 7 ms 7500 KB Output is correct
71 Correct 7 ms 7500 KB Output is correct
72 Correct 7 ms 7496 KB Output is correct
73 Correct 7 ms 7508 KB Output is correct
74 Correct 7 ms 7500 KB Output is correct
75 Correct 7 ms 7628 KB Output is correct
76 Correct 33 ms 9932 KB Output is correct
77 Correct 26 ms 10444 KB Output is correct
78 Correct 33 ms 10768 KB Output is correct
79 Correct 6 ms 8164 KB Output is correct
80 Correct 6 ms 8140 KB Output is correct
81 Correct 6 ms 8140 KB Output is correct
82 Correct 6 ms 8140 KB Output is correct
83 Correct 6 ms 8140 KB Output is correct
84 Correct 7 ms 7628 KB Output is correct
85 Correct 7 ms 7628 KB Output is correct
86 Correct 7 ms 7628 KB Output is correct
87 Correct 7 ms 7628 KB Output is correct
88 Correct 7 ms 7628 KB Output is correct
89 Correct 7 ms 7628 KB Output is correct
90 Correct 37 ms 11100 KB Output is correct
91 Correct 36 ms 11028 KB Output is correct
92 Correct 48 ms 11048 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 7244 KB Output is correct
2 Correct 5 ms 7240 KB Output is correct
3 Correct 5 ms 7244 KB Output is correct
4 Correct 5 ms 7244 KB Output is correct
5 Correct 5 ms 7336 KB Output is correct
6 Correct 5 ms 7244 KB Output is correct
7 Correct 4 ms 7244 KB Output is correct
8 Correct 5 ms 7244 KB Output is correct
9 Correct 5 ms 7372 KB Output is correct
10 Correct 5 ms 7292 KB Output is correct
11 Correct 5 ms 7372 KB Output is correct
12 Correct 5 ms 7372 KB Output is correct
13 Correct 5 ms 7372 KB Output is correct
14 Correct 5 ms 7372 KB Output is correct
15 Correct 5 ms 7412 KB Output is correct
16 Correct 5 ms 7372 KB Output is correct
17 Correct 5 ms 7372 KB Output is correct
18 Correct 5 ms 7372 KB Output is correct
19 Correct 6 ms 7372 KB Output is correct
20 Correct 7 ms 7372 KB Output is correct
21 Correct 5 ms 7372 KB Output is correct
22 Correct 5 ms 7372 KB Output is correct
23 Correct 5 ms 7396 KB Output is correct
24 Correct 27 ms 11284 KB Output is correct
25 Correct 29 ms 11288 KB Output is correct
26 Correct 28 ms 11188 KB Output is correct
27 Correct 9 ms 8652 KB Output is correct
28 Correct 10 ms 8652 KB Output is correct
29 Correct 9 ms 8684 KB Output is correct
30 Correct 9 ms 8652 KB Output is correct
31 Correct 9 ms 8696 KB Output is correct
32 Correct 11 ms 8652 KB Output is correct
33 Correct 19 ms 9548 KB Output is correct
34 Correct 17 ms 9596 KB Output is correct
35 Correct 23 ms 9536 KB Output is correct
36 Correct 19 ms 9600 KB Output is correct
37 Correct 16 ms 9608 KB Output is correct
38 Correct 16 ms 9648 KB Output is correct
39 Correct 35 ms 12764 KB Output is correct
40 Correct 37 ms 12800 KB Output is correct
41 Correct 40 ms 12736 KB Output is correct
42 Correct 5 ms 7336 KB Output is correct
43 Correct 5 ms 7244 KB Output is correct
44 Correct 6 ms 7244 KB Output is correct
45 Correct 5 ms 7244 KB Output is correct
46 Correct 5 ms 7372 KB Output is correct
47 Correct 5 ms 7372 KB Output is correct
48 Correct 6 ms 7500 KB Output is correct
49 Correct 5 ms 7372 KB Output is correct
50 Correct 5 ms 7372 KB Output is correct
51 Correct 5 ms 7372 KB Output is correct
52 Correct 5 ms 7372 KB Output is correct
53 Correct 5 ms 7372 KB Output is correct
54 Correct 5 ms 7372 KB Output is correct
55 Correct 5 ms 7388 KB Output is correct
56 Correct 5 ms 7372 KB Output is correct
57 Correct 5 ms 7372 KB Output is correct
58 Correct 5 ms 7372 KB Output is correct
59 Correct 5 ms 7332 KB Output is correct
60 Correct 5 ms 7372 KB Output is correct
61 Correct 7 ms 7372 KB Output is correct
62 Correct 6 ms 7376 KB Output is correct
63 Correct 5 ms 7372 KB Output is correct
64 Correct 5 ms 7372 KB Output is correct
65 Correct 5 ms 7372 KB Output is correct
66 Correct 5 ms 7372 KB Output is correct
67 Correct 5 ms 7408 KB Output is correct
68 Correct 5 ms 7372 KB Output is correct
69 Correct 5 ms 7372 KB Output is correct
70 Correct 5 ms 7372 KB Output is correct
71 Correct 6 ms 7372 KB Output is correct
72 Correct 5 ms 7372 KB Output is correct
73 Correct 7 ms 7372 KB Output is correct
74 Correct 5 ms 7316 KB Output is correct
75 Correct 5 ms 7372 KB Output is correct
76 Correct 7 ms 7300 KB Output is correct
77 Correct 5 ms 7372 KB Output is correct
78 Correct 7 ms 7372 KB Output is correct
79 Correct 5 ms 7372 KB Output is correct
80 Correct 6 ms 7628 KB Output is correct
81 Correct 5 ms 7500 KB Output is correct
82 Correct 6 ms 7756 KB Output is correct
83 Correct 6 ms 7628 KB Output is correct
84 Correct 6 ms 7756 KB Output is correct
85 Correct 7 ms 7500 KB Output is correct
86 Correct 7 ms 7500 KB Output is correct
87 Correct 7 ms 7496 KB Output is correct
88 Correct 7 ms 7508 KB Output is correct
89 Correct 7 ms 7500 KB Output is correct
90 Correct 7 ms 7628 KB Output is correct
91 Correct 33 ms 9932 KB Output is correct
92 Correct 26 ms 10444 KB Output is correct
93 Correct 33 ms 10768 KB Output is correct
94 Correct 6 ms 8164 KB Output is correct
95 Correct 6 ms 8140 KB Output is correct
96 Correct 6 ms 8140 KB Output is correct
97 Correct 6 ms 8140 KB Output is correct
98 Correct 6 ms 8140 KB Output is correct
99 Correct 7 ms 7628 KB Output is correct
100 Correct 7 ms 7628 KB Output is correct
101 Correct 7 ms 7628 KB Output is correct
102 Correct 7 ms 7628 KB Output is correct
103 Correct 7 ms 7628 KB Output is correct
104 Correct 7 ms 7628 KB Output is correct
105 Correct 37 ms 11100 KB Output is correct
106 Correct 36 ms 11028 KB Output is correct
107 Correct 48 ms 11048 KB Output is correct
108 Correct 9 ms 8696 KB Output is correct
109 Correct 139 ms 77864 KB Output is correct
110 Correct 90 ms 45816 KB Output is correct
111 Correct 74 ms 35788 KB Output is correct
112 Correct 89 ms 40200 KB Output is correct
113 Correct 57 ms 29128 KB Output is correct
114 Correct 25 ms 9564 KB Output is correct
115 Correct 20 ms 9420 KB Output is correct
116 Correct 24 ms 10220 KB Output is correct
117 Correct 20 ms 9496 KB Output is correct
118 Correct 24 ms 9684 KB Output is correct
119 Correct 19 ms 9532 KB Output is correct
120 Correct 28 ms 10820 KB Output is correct
121 Correct 11 ms 8760 KB Output is correct
122 Correct 32 ms 11328 KB Output is correct
123 Correct 13 ms 8504 KB Output is correct
124 Correct 46 ms 12192 KB Output is correct
125 Correct 15 ms 9292 KB Output is correct
126 Correct 14 ms 9292 KB Output is correct
127 Correct 22 ms 9740 KB Output is correct
128 Correct 14 ms 9036 KB Output is correct
129 Correct 16 ms 9132 KB Output is correct
130 Correct 9 ms 8780 KB Output is correct
131 Correct 201 ms 107044 KB Output is correct
132 Correct 166 ms 78052 KB Output is correct
133 Correct 153 ms 65192 KB Output is correct
134 Correct 138 ms 57540 KB Output is correct
135 Correct 112 ms 52200 KB Output is correct
136 Correct 27 ms 10656 KB Output is correct
137 Correct 29 ms 10656 KB Output is correct
138 Correct 27 ms 10700 KB Output is correct
139 Correct 27 ms 10692 KB Output is correct
140 Correct 26 ms 10636 KB Output is correct
141 Correct 33 ms 10716 KB Output is correct
142 Correct 47 ms 13312 KB Output is correct
143 Correct 16 ms 9656 KB Output is correct
144 Correct 56 ms 13340 KB Output is correct
145 Correct 16 ms 9652 KB Output is correct
146 Correct 52 ms 13324 KB Output is correct
147 Correct 17 ms 9608 KB Output is correct
148 Correct 23 ms 10048 KB Output is correct
149 Correct 18 ms 9932 KB Output is correct
150 Correct 18 ms 9912 KB Output is correct
151 Correct 17 ms 9804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 7244 KB Output is correct
2 Correct 5 ms 7240 KB Output is correct
3 Correct 5 ms 7244 KB Output is correct
4 Correct 5 ms 7244 KB Output is correct
5 Correct 5 ms 7336 KB Output is correct
6 Correct 5 ms 7244 KB Output is correct
7 Correct 4 ms 7244 KB Output is correct
8 Correct 5 ms 7244 KB Output is correct
9 Correct 5 ms 7372 KB Output is correct
10 Correct 5 ms 7292 KB Output is correct
11 Correct 5 ms 7372 KB Output is correct
12 Correct 5 ms 7372 KB Output is correct
13 Correct 5 ms 7372 KB Output is correct
14 Correct 5 ms 7372 KB Output is correct
15 Correct 5 ms 7412 KB Output is correct
16 Correct 5 ms 7372 KB Output is correct
17 Correct 5 ms 7372 KB Output is correct
18 Correct 5 ms 7372 KB Output is correct
19 Correct 6 ms 7372 KB Output is correct
20 Correct 7 ms 7372 KB Output is correct
21 Correct 5 ms 7372 KB Output is correct
22 Correct 5 ms 7372 KB Output is correct
23 Correct 5 ms 7396 KB Output is correct
24 Correct 27 ms 11284 KB Output is correct
25 Correct 29 ms 11288 KB Output is correct
26 Correct 28 ms 11188 KB Output is correct
27 Correct 9 ms 8652 KB Output is correct
28 Correct 10 ms 8652 KB Output is correct
29 Correct 9 ms 8684 KB Output is correct
30 Correct 9 ms 8652 KB Output is correct
31 Correct 9 ms 8696 KB Output is correct
32 Correct 11 ms 8652 KB Output is correct
33 Correct 19 ms 9548 KB Output is correct
34 Correct 17 ms 9596 KB Output is correct
35 Correct 23 ms 9536 KB Output is correct
36 Correct 19 ms 9600 KB Output is correct
37 Correct 16 ms 9608 KB Output is correct
38 Correct 16 ms 9648 KB Output is correct
39 Correct 35 ms 12764 KB Output is correct
40 Correct 37 ms 12800 KB Output is correct
41 Correct 40 ms 12736 KB Output is correct
42 Correct 28 ms 13720 KB Output is correct
43 Correct 18 ms 11256 KB Output is correct
44 Correct 29 ms 14184 KB Output is correct
45 Correct 20 ms 11864 KB Output is correct
46 Correct 20 ms 11468 KB Output is correct
47 Correct 28 ms 14380 KB Output is correct
48 Correct 67 ms 21760 KB Output is correct
49 Correct 41 ms 15816 KB Output is correct
50 Correct 45 ms 18308 KB Output is correct
51 Correct 57 ms 18744 KB Output is correct
52 Correct 72 ms 19032 KB Output is correct
53 Correct 52 ms 17004 KB Output is correct
54 Correct 27 ms 14260 KB Output is correct
55 Correct 26 ms 14284 KB Output is correct
56 Correct 28 ms 14280 KB Output is correct
57 Correct 28 ms 14280 KB Output is correct
58 Correct 28 ms 14308 KB Output is correct
59 Correct 29 ms 14284 KB Output is correct
60 Correct 80 ms 23316 KB Output is correct
61 Correct 81 ms 23364 KB Output is correct
62 Correct 74 ms 23352 KB Output is correct
63 Correct 74 ms 23312 KB Output is correct
64 Correct 91 ms 23372 KB Output is correct
65 Correct 73 ms 23364 KB Output is correct
66 Correct 77 ms 22508 KB Output is correct
67 Correct 94 ms 22592 KB Output is correct
68 Correct 91 ms 22528 KB Output is correct
69 Correct 5 ms 7336 KB Output is correct
70 Correct 5 ms 7244 KB Output is correct
71 Correct 6 ms 7244 KB Output is correct
72 Correct 5 ms 7244 KB Output is correct
73 Correct 5 ms 7372 KB Output is correct
74 Correct 5 ms 7372 KB Output is correct
75 Correct 6 ms 7500 KB Output is correct
76 Correct 5 ms 7372 KB Output is correct
77 Correct 5 ms 7372 KB Output is correct
78 Correct 5 ms 7372 KB Output is correct
79 Correct 5 ms 7372 KB Output is correct
80 Correct 5 ms 7372 KB Output is correct
81 Correct 5 ms 7372 KB Output is correct
82 Correct 5 ms 7388 KB Output is correct
83 Correct 5 ms 7372 KB Output is correct
84 Correct 5 ms 7372 KB Output is correct
85 Correct 5 ms 7372 KB Output is correct
86 Correct 5 ms 7332 KB Output is correct
87 Correct 5 ms 7372 KB Output is correct
88 Correct 7 ms 7372 KB Output is correct
89 Correct 6 ms 7376 KB Output is correct
90 Correct 5 ms 7372 KB Output is correct
91 Correct 5 ms 7372 KB Output is correct
92 Correct 5 ms 7372 KB Output is correct
93 Correct 5 ms 7372 KB Output is correct
94 Correct 5 ms 7408 KB Output is correct
95 Correct 5 ms 7372 KB Output is correct
96 Correct 5 ms 7372 KB Output is correct
97 Correct 5 ms 7372 KB Output is correct
98 Correct 6 ms 7372 KB Output is correct
99 Correct 5 ms 7372 KB Output is correct
100 Correct 7 ms 7372 KB Output is correct
101 Correct 5 ms 7316 KB Output is correct
102 Correct 5 ms 7372 KB Output is correct
103 Correct 7 ms 7300 KB Output is correct
104 Correct 5 ms 7372 KB Output is correct
105 Correct 7 ms 7372 KB Output is correct
106 Correct 5 ms 7372 KB Output is correct
107 Correct 6 ms 7628 KB Output is correct
108 Correct 5 ms 7500 KB Output is correct
109 Correct 6 ms 7756 KB Output is correct
110 Correct 6 ms 7628 KB Output is correct
111 Correct 6 ms 7756 KB Output is correct
112 Correct 7 ms 7500 KB Output is correct
113 Correct 7 ms 7500 KB Output is correct
114 Correct 7 ms 7496 KB Output is correct
115 Correct 7 ms 7508 KB Output is correct
116 Correct 7 ms 7500 KB Output is correct
117 Correct 7 ms 7628 KB Output is correct
118 Correct 33 ms 9932 KB Output is correct
119 Correct 26 ms 10444 KB Output is correct
120 Correct 33 ms 10768 KB Output is correct
121 Correct 6 ms 8164 KB Output is correct
122 Correct 6 ms 8140 KB Output is correct
123 Correct 6 ms 8140 KB Output is correct
124 Correct 6 ms 8140 KB Output is correct
125 Correct 6 ms 8140 KB Output is correct
126 Correct 7 ms 7628 KB Output is correct
127 Correct 7 ms 7628 KB Output is correct
128 Correct 7 ms 7628 KB Output is correct
129 Correct 7 ms 7628 KB Output is correct
130 Correct 7 ms 7628 KB Output is correct
131 Correct 7 ms 7628 KB Output is correct
132 Correct 37 ms 11100 KB Output is correct
133 Correct 36 ms 11028 KB Output is correct
134 Correct 48 ms 11048 KB Output is correct
135 Correct 9 ms 8696 KB Output is correct
136 Correct 139 ms 77864 KB Output is correct
137 Correct 90 ms 45816 KB Output is correct
138 Correct 74 ms 35788 KB Output is correct
139 Correct 89 ms 40200 KB Output is correct
140 Correct 57 ms 29128 KB Output is correct
141 Correct 25 ms 9564 KB Output is correct
142 Correct 20 ms 9420 KB Output is correct
143 Correct 24 ms 10220 KB Output is correct
144 Correct 20 ms 9496 KB Output is correct
145 Correct 24 ms 9684 KB Output is correct
146 Correct 19 ms 9532 KB Output is correct
147 Correct 28 ms 10820 KB Output is correct
148 Correct 11 ms 8760 KB Output is correct
149 Correct 32 ms 11328 KB Output is correct
150 Correct 13 ms 8504 KB Output is correct
151 Correct 46 ms 12192 KB Output is correct
152 Correct 15 ms 9292 KB Output is correct
153 Correct 14 ms 9292 KB Output is correct
154 Correct 22 ms 9740 KB Output is correct
155 Correct 14 ms 9036 KB Output is correct
156 Correct 16 ms 9132 KB Output is correct
157 Correct 9 ms 8780 KB Output is correct
158 Correct 201 ms 107044 KB Output is correct
159 Correct 166 ms 78052 KB Output is correct
160 Correct 153 ms 65192 KB Output is correct
161 Correct 138 ms 57540 KB Output is correct
162 Correct 112 ms 52200 KB Output is correct
163 Correct 27 ms 10656 KB Output is correct
164 Correct 29 ms 10656 KB Output is correct
165 Correct 27 ms 10700 KB Output is correct
166 Correct 27 ms 10692 KB Output is correct
167 Correct 26 ms 10636 KB Output is correct
168 Correct 33 ms 10716 KB Output is correct
169 Correct 47 ms 13312 KB Output is correct
170 Correct 16 ms 9656 KB Output is correct
171 Correct 56 ms 13340 KB Output is correct
172 Correct 16 ms 9652 KB Output is correct
173 Correct 52 ms 13324 KB Output is correct
174 Correct 17 ms 9608 KB Output is correct
175 Correct 23 ms 10048 KB Output is correct
176 Correct 18 ms 9932 KB Output is correct
177 Correct 18 ms 9912 KB Output is correct
178 Correct 17 ms 9804 KB Output is correct
179 Correct 19 ms 11748 KB Output is correct
180 Correct 359 ms 206532 KB Output is correct
181 Correct 424 ms 230816 KB Output is correct
182 Correct 618 ms 286584 KB Output is correct
183 Correct 316 ms 147716 KB Output is correct
184 Correct 305 ms 122952 KB Output is correct
185 Correct 48 ms 14712 KB Output is correct
186 Correct 43 ms 16916 KB Output is correct
187 Correct 55 ms 16108 KB Output is correct
188 Correct 55 ms 16020 KB Output is correct
189 Correct 54 ms 17092 KB Output is correct
190 Correct 56 ms 17204 KB Output is correct
191 Correct 59 ms 17220 KB Output is correct
192 Correct 45 ms 14092 KB Output is correct
193 Correct 40 ms 14532 KB Output is correct
194 Correct 26 ms 14540 KB Output is correct
195 Correct 868 ms 506324 KB Output is correct
196 Correct 650 ms 360656 KB Output is correct
197 Correct 571 ms 296616 KB Output is correct
198 Correct 547 ms 258236 KB Output is correct
199 Correct 521 ms 231464 KB Output is correct
200 Correct 90 ms 25088 KB Output is correct
201 Correct 93 ms 25244 KB Output is correct
202 Correct 100 ms 25220 KB Output is correct
203 Correct 97 ms 25140 KB Output is correct
204 Correct 97 ms 25124 KB Output is correct
205 Correct 96 ms 25160 KB Output is correct
206 Correct 90 ms 22908 KB Output is correct
207 Correct 74 ms 23456 KB Output is correct
208 Correct 82 ms 22824 KB Output is correct
209 Correct 72 ms 23456 KB Output is correct
210 Correct 83 ms 22820 KB Output is correct
211 Correct 74 ms 23424 KB Output is correct
212 Correct 83 ms 24808 KB Output is correct
213 Correct 82 ms 21888 KB Output is correct
214 Correct 81 ms 21444 KB Output is correct
215 Correct 77 ms 21316 KB Output is correct