Submission #736396

# Submission time Handle Problem Language Result Execution time Memory
736396 2023-05-05T14:32:00 Z minhcool Painting Walls (APIO20_paint) C++17
100 / 100
1161 ms 22148 KB
#include "paint.h"
#include<bits/stdc++.h>
using namespace std;
 
#define fi first
#define se second
#define pb push_back
#define mp make_pair
 
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
 
const int N = 4e5 + 5;
 
const int oo = 1e18 + 7, mod = 1e9 + 7;
 
int n, m, k;
 
int arr[N];
 
vector<int> like[N];
 
int total[N];
 
bool okay[N];
 
int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B){
	n = N, m = M, k = K;
	for(int i = 0; i < n; i++) arr[i + 1] = C[i] + 1;
	for(int i = 0; i < m; i++){
		for(auto it : B[i]) like[it + 1].pb(i + 1);
	}
	for(int i = 1; i <= k; i++) assert(like[i].size() <= 700);
	for(int i = 1; i <= m; i++){
		for(auto it : like[arr[i]]){
			int temp = (it - (i - 1) + 2 * m) % m;
			if(!temp) temp = m;
			total[temp]++;
			//okay[1] |= (total[temp] == m);
		}
	}
	int cnt = 0;
	for(int i = 1; i <= m; i++) cnt += (total[i] == m);
	okay[1] = (cnt != 0);
	int tempp = (n / m) + 1;
	tempp *= m;
	for(int i = m + 1; i <= n; i++){
		for(auto it : like[arr[i - m]]){
			int temp = (it - i + 1 + tempp) % m;
         // assert(temp >= 0);
		//	cout << i << " " << temp << "\n";
			if(!temp) temp = m;
			if(total[temp] == m) cnt--;
			//cnt[total[temp]]--;
			total[temp]--;
			//cnt[total[temp]]++;
			//total[temp]++;
		}
		for(auto it : like[arr[i]]){
			int temp = (it - i + 1 + tempp) % m;
         // assert(temp >= 0);
			if(!temp) temp = m;
			//cnt[total[temp]]--;
			total[temp]++;
			if(total[temp] == m) cnt++;
			//cnt[total[temp]]++;
		}
		okay[i - m + 1] = (cnt != 0);
	}
	//for(int i = 1; i <= (n - m + 1); i++) cout << okay[i] << " ";
	//cout << "\n";
	if(!okay[1]) return -1;
	vector<int> okays;
	for(int i = 1; i <= n - m + 1; i++) if(okay[i]) okays.pb(i);
	int ans = 1, itr = m;
	while(itr < n){
		//cout << itr << "\n";
		vector<int>::iterator it = lower_bound(okays.begin(), okays.end(), itr + 2);
		assert(it != okays.begin());
		it--;
		int temp = ((*it) + m - 1);
		if(temp <= itr) return -1;
		itr = temp;
		ans++;
	}
	return ans;
}

Compilation message

paint.cpp:16:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   16 | const int oo = 1e18 + 7, mod = 1e9 + 7;
      |                ~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 7 ms 9684 KB Output is correct
2 Correct 5 ms 9684 KB Output is correct
3 Correct 6 ms 9812 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9608 KB Output is correct
6 Correct 5 ms 9664 KB Output is correct
7 Correct 5 ms 9684 KB Output is correct
8 Correct 5 ms 9616 KB Output is correct
9 Correct 6 ms 9684 KB Output is correct
10 Correct 5 ms 9644 KB Output is correct
11 Correct 7 ms 9684 KB Output is correct
12 Correct 5 ms 9672 KB Output is correct
13 Correct 6 ms 9764 KB Output is correct
14 Correct 6 ms 9684 KB Output is correct
15 Correct 6 ms 9684 KB Output is correct
16 Correct 6 ms 9684 KB Output is correct
17 Correct 6 ms 9672 KB Output is correct
18 Correct 6 ms 9700 KB Output is correct
19 Correct 6 ms 9684 KB Output is correct
20 Correct 6 ms 9684 KB Output is correct
21 Correct 6 ms 9684 KB Output is correct
22 Correct 21 ms 13656 KB Output is correct
23 Correct 23 ms 13600 KB Output is correct
24 Correct 23 ms 13524 KB Output is correct
25 Correct 8 ms 10104 KB Output is correct
26 Correct 8 ms 10068 KB Output is correct
27 Correct 7 ms 9940 KB Output is correct
28 Correct 9 ms 9912 KB Output is correct
29 Correct 9 ms 9940 KB Output is correct
30 Correct 8 ms 9940 KB Output is correct
31 Correct 13 ms 11048 KB Output is correct
32 Correct 13 ms 11000 KB Output is correct
33 Correct 13 ms 11068 KB Output is correct
34 Correct 13 ms 11092 KB Output is correct
35 Correct 13 ms 11016 KB Output is correct
36 Correct 13 ms 11092 KB Output is correct
37 Correct 26 ms 14036 KB Output is correct
38 Correct 25 ms 14036 KB Output is correct
39 Correct 26 ms 14048 KB Output is correct
40 Correct 19 ms 11472 KB Output is correct
41 Correct 15 ms 10708 KB Output is correct
42 Correct 17 ms 11340 KB Output is correct
43 Correct 12 ms 10452 KB Output is correct
44 Correct 14 ms 10468 KB Output is correct
45 Correct 15 ms 10880 KB Output is correct
46 Correct 41 ms 19532 KB Output is correct
47 Correct 32 ms 15124 KB Output is correct
48 Correct 35 ms 17484 KB Output is correct
49 Correct 39 ms 17748 KB Output is correct
50 Correct 42 ms 17412 KB Output is correct
51 Correct 35 ms 15132 KB Output is correct
52 Correct 20 ms 11640 KB Output is correct
53 Correct 20 ms 11544 KB Output is correct
54 Correct 18 ms 11308 KB Output is correct
55 Correct 15 ms 10876 KB Output is correct
56 Correct 15 ms 10964 KB Output is correct
57 Correct 15 ms 10964 KB Output is correct
58 Correct 46 ms 20268 KB Output is correct
59 Correct 47 ms 20300 KB Output is correct
60 Correct 47 ms 20216 KB Output is correct
61 Correct 45 ms 20212 KB Output is correct
62 Correct 45 ms 20308 KB Output is correct
63 Correct 46 ms 20316 KB Output is correct
64 Correct 52 ms 19220 KB Output is correct
65 Correct 53 ms 19220 KB Output is correct
66 Correct 54 ms 19328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 9684 KB Output is correct
2 Correct 5 ms 9684 KB Output is correct
3 Correct 6 ms 9812 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9608 KB Output is correct
6 Correct 5 ms 9664 KB Output is correct
7 Correct 5 ms 9684 KB Output is correct
8 Correct 5 ms 9616 KB Output is correct
9 Correct 6 ms 9684 KB Output is correct
10 Correct 5 ms 9644 KB Output is correct
11 Correct 7 ms 9684 KB Output is correct
12 Correct 5 ms 9672 KB Output is correct
13 Correct 6 ms 9764 KB Output is correct
14 Correct 6 ms 9684 KB Output is correct
15 Correct 6 ms 9684 KB Output is correct
16 Correct 6 ms 9684 KB Output is correct
17 Correct 6 ms 9672 KB Output is correct
18 Correct 6 ms 9700 KB Output is correct
19 Correct 6 ms 9684 KB Output is correct
20 Correct 6 ms 9684 KB Output is correct
21 Correct 6 ms 9684 KB Output is correct
22 Correct 7 ms 9684 KB Output is correct
23 Correct 5 ms 9688 KB Output is correct
24 Correct 5 ms 9684 KB Output is correct
25 Correct 5 ms 9684 KB Output is correct
26 Correct 5 ms 9684 KB Output is correct
27 Correct 5 ms 9684 KB Output is correct
28 Correct 5 ms 9684 KB Output is correct
29 Correct 5 ms 9684 KB Output is correct
30 Correct 6 ms 9656 KB Output is correct
31 Correct 5 ms 9684 KB Output is correct
32 Correct 5 ms 9684 KB Output is correct
33 Correct 5 ms 9684 KB Output is correct
34 Correct 5 ms 9744 KB Output is correct
35 Correct 5 ms 9684 KB Output is correct
36 Correct 6 ms 9812 KB Output is correct
37 Correct 6 ms 9684 KB Output is correct
38 Correct 6 ms 9664 KB Output is correct
39 Correct 5 ms 9684 KB Output is correct
40 Correct 7 ms 9708 KB Output is correct
41 Correct 6 ms 9684 KB Output is correct
42 Correct 5 ms 9720 KB Output is correct
43 Correct 6 ms 9684 KB Output is correct
44 Correct 5 ms 9684 KB Output is correct
45 Correct 5 ms 9684 KB Output is correct
46 Correct 5 ms 9684 KB Output is correct
47 Correct 6 ms 9704 KB Output is correct
48 Correct 5 ms 9684 KB Output is correct
49 Correct 5 ms 9684 KB Output is correct
50 Correct 5 ms 9684 KB Output is correct
51 Correct 6 ms 9648 KB Output is correct
52 Correct 5 ms 9684 KB Output is correct
53 Correct 5 ms 9652 KB Output is correct
54 Correct 6 ms 9684 KB Output is correct
55 Correct 5 ms 9684 KB Output is correct
56 Correct 6 ms 9684 KB Output is correct
57 Correct 5 ms 9700 KB Output is correct
58 Correct 6 ms 9684 KB Output is correct
59 Correct 6 ms 9684 KB Output is correct
60 Correct 5 ms 9684 KB Output is correct
61 Correct 5 ms 9684 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 9684 KB Output is correct
2 Correct 5 ms 9688 KB Output is correct
3 Correct 7 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 6 ms 9812 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9608 KB Output is correct
8 Correct 5 ms 9664 KB Output is correct
9 Correct 5 ms 9684 KB Output is correct
10 Correct 5 ms 9616 KB Output is correct
11 Correct 6 ms 9684 KB Output is correct
12 Correct 5 ms 9644 KB Output is correct
13 Correct 7 ms 9684 KB Output is correct
14 Correct 5 ms 9672 KB Output is correct
15 Correct 6 ms 9764 KB Output is correct
16 Correct 6 ms 9684 KB Output is correct
17 Correct 6 ms 9684 KB Output is correct
18 Correct 6 ms 9684 KB Output is correct
19 Correct 6 ms 9672 KB Output is correct
20 Correct 6 ms 9700 KB Output is correct
21 Correct 6 ms 9684 KB Output is correct
22 Correct 6 ms 9684 KB Output is correct
23 Correct 6 ms 9684 KB Output is correct
24 Correct 21 ms 13656 KB Output is correct
25 Correct 23 ms 13600 KB Output is correct
26 Correct 23 ms 13524 KB Output is correct
27 Correct 5 ms 9684 KB Output is correct
28 Correct 5 ms 9684 KB Output is correct
29 Correct 5 ms 9684 KB Output is correct
30 Correct 5 ms 9684 KB Output is correct
31 Correct 5 ms 9684 KB Output is correct
32 Correct 5 ms 9684 KB Output is correct
33 Correct 6 ms 9656 KB Output is correct
34 Correct 5 ms 9684 KB Output is correct
35 Correct 5 ms 9684 KB Output is correct
36 Correct 5 ms 9684 KB Output is correct
37 Correct 5 ms 9744 KB Output is correct
38 Correct 5 ms 9684 KB Output is correct
39 Correct 6 ms 9812 KB Output is correct
40 Correct 6 ms 9684 KB Output is correct
41 Correct 6 ms 9664 KB Output is correct
42 Correct 5 ms 9684 KB Output is correct
43 Correct 7 ms 9708 KB Output is correct
44 Correct 6 ms 9684 KB Output is correct
45 Correct 5 ms 9720 KB Output is correct
46 Correct 6 ms 9684 KB Output is correct
47 Correct 5 ms 9684 KB Output is correct
48 Correct 5 ms 9684 KB Output is correct
49 Correct 5 ms 9684 KB Output is correct
50 Correct 6 ms 9704 KB Output is correct
51 Correct 5 ms 9684 KB Output is correct
52 Correct 5 ms 9684 KB Output is correct
53 Correct 5 ms 9684 KB Output is correct
54 Correct 6 ms 9648 KB Output is correct
55 Correct 5 ms 9684 KB Output is correct
56 Correct 5 ms 9652 KB Output is correct
57 Correct 6 ms 9684 KB Output is correct
58 Correct 5 ms 9684 KB Output is correct
59 Correct 6 ms 9684 KB Output is correct
60 Correct 5 ms 9700 KB Output is correct
61 Correct 6 ms 9684 KB Output is correct
62 Correct 6 ms 9684 KB Output is correct
63 Correct 5 ms 9684 KB Output is correct
64 Correct 5 ms 9684 KB Output is correct
65 Correct 5 ms 9720 KB Output is correct
66 Correct 6 ms 9684 KB Output is correct
67 Correct 6 ms 9684 KB Output is correct
68 Correct 6 ms 9684 KB Output is correct
69 Correct 6 ms 9684 KB Output is correct
70 Correct 8 ms 9900 KB Output is correct
71 Correct 7 ms 9812 KB Output is correct
72 Correct 7 ms 9812 KB Output is correct
73 Correct 6 ms 9812 KB Output is correct
74 Correct 8 ms 9812 KB Output is correct
75 Correct 6 ms 9812 KB Output is correct
76 Correct 23 ms 12372 KB Output is correct
77 Correct 20 ms 12728 KB Output is correct
78 Correct 26 ms 13104 KB Output is correct
79 Correct 6 ms 9684 KB Output is correct
80 Correct 7 ms 9744 KB Output is correct
81 Correct 6 ms 9684 KB Output is correct
82 Correct 7 ms 9752 KB Output is correct
83 Correct 6 ms 9684 KB Output is correct
84 Correct 7 ms 9940 KB Output is correct
85 Correct 7 ms 9940 KB Output is correct
86 Correct 9 ms 9868 KB Output is correct
87 Correct 7 ms 9948 KB Output is correct
88 Correct 7 ms 9864 KB Output is correct
89 Correct 7 ms 9940 KB Output is correct
90 Correct 30 ms 13340 KB Output is correct
91 Correct 34 ms 13396 KB Output is correct
92 Correct 30 ms 13468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 9684 KB Output is correct
2 Correct 5 ms 9688 KB Output is correct
3 Correct 7 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 6 ms 9812 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9608 KB Output is correct
8 Correct 5 ms 9664 KB Output is correct
9 Correct 5 ms 9684 KB Output is correct
10 Correct 5 ms 9616 KB Output is correct
11 Correct 6 ms 9684 KB Output is correct
12 Correct 5 ms 9644 KB Output is correct
13 Correct 7 ms 9684 KB Output is correct
14 Correct 5 ms 9672 KB Output is correct
15 Correct 6 ms 9764 KB Output is correct
16 Correct 6 ms 9684 KB Output is correct
17 Correct 6 ms 9684 KB Output is correct
18 Correct 6 ms 9684 KB Output is correct
19 Correct 6 ms 9672 KB Output is correct
20 Correct 6 ms 9700 KB Output is correct
21 Correct 6 ms 9684 KB Output is correct
22 Correct 6 ms 9684 KB Output is correct
23 Correct 6 ms 9684 KB Output is correct
24 Correct 21 ms 13656 KB Output is correct
25 Correct 23 ms 13600 KB Output is correct
26 Correct 23 ms 13524 KB Output is correct
27 Correct 8 ms 10104 KB Output is correct
28 Correct 8 ms 10068 KB Output is correct
29 Correct 7 ms 9940 KB Output is correct
30 Correct 9 ms 9912 KB Output is correct
31 Correct 9 ms 9940 KB Output is correct
32 Correct 8 ms 9940 KB Output is correct
33 Correct 13 ms 11048 KB Output is correct
34 Correct 13 ms 11000 KB Output is correct
35 Correct 13 ms 11068 KB Output is correct
36 Correct 13 ms 11092 KB Output is correct
37 Correct 13 ms 11016 KB Output is correct
38 Correct 13 ms 11092 KB Output is correct
39 Correct 26 ms 14036 KB Output is correct
40 Correct 25 ms 14036 KB Output is correct
41 Correct 26 ms 14048 KB Output is correct
42 Correct 5 ms 9684 KB Output is correct
43 Correct 5 ms 9684 KB Output is correct
44 Correct 5 ms 9684 KB Output is correct
45 Correct 5 ms 9684 KB Output is correct
46 Correct 5 ms 9684 KB Output is correct
47 Correct 5 ms 9684 KB Output is correct
48 Correct 6 ms 9656 KB Output is correct
49 Correct 5 ms 9684 KB Output is correct
50 Correct 5 ms 9684 KB Output is correct
51 Correct 5 ms 9684 KB Output is correct
52 Correct 5 ms 9744 KB Output is correct
53 Correct 5 ms 9684 KB Output is correct
54 Correct 6 ms 9812 KB Output is correct
55 Correct 6 ms 9684 KB Output is correct
56 Correct 6 ms 9664 KB Output is correct
57 Correct 5 ms 9684 KB Output is correct
58 Correct 7 ms 9708 KB Output is correct
59 Correct 6 ms 9684 KB Output is correct
60 Correct 5 ms 9720 KB Output is correct
61 Correct 6 ms 9684 KB Output is correct
62 Correct 5 ms 9684 KB Output is correct
63 Correct 5 ms 9684 KB Output is correct
64 Correct 5 ms 9684 KB Output is correct
65 Correct 6 ms 9704 KB Output is correct
66 Correct 5 ms 9684 KB Output is correct
67 Correct 5 ms 9684 KB Output is correct
68 Correct 5 ms 9684 KB Output is correct
69 Correct 6 ms 9648 KB Output is correct
70 Correct 5 ms 9684 KB Output is correct
71 Correct 5 ms 9652 KB Output is correct
72 Correct 6 ms 9684 KB Output is correct
73 Correct 5 ms 9684 KB Output is correct
74 Correct 6 ms 9684 KB Output is correct
75 Correct 5 ms 9700 KB Output is correct
76 Correct 6 ms 9684 KB Output is correct
77 Correct 6 ms 9684 KB Output is correct
78 Correct 5 ms 9684 KB Output is correct
79 Correct 5 ms 9684 KB Output is correct
80 Correct 5 ms 9720 KB Output is correct
81 Correct 6 ms 9684 KB Output is correct
82 Correct 6 ms 9684 KB Output is correct
83 Correct 6 ms 9684 KB Output is correct
84 Correct 6 ms 9684 KB Output is correct
85 Correct 8 ms 9900 KB Output is correct
86 Correct 7 ms 9812 KB Output is correct
87 Correct 7 ms 9812 KB Output is correct
88 Correct 6 ms 9812 KB Output is correct
89 Correct 8 ms 9812 KB Output is correct
90 Correct 6 ms 9812 KB Output is correct
91 Correct 23 ms 12372 KB Output is correct
92 Correct 20 ms 12728 KB Output is correct
93 Correct 26 ms 13104 KB Output is correct
94 Correct 6 ms 9684 KB Output is correct
95 Correct 7 ms 9744 KB Output is correct
96 Correct 6 ms 9684 KB Output is correct
97 Correct 7 ms 9752 KB Output is correct
98 Correct 6 ms 9684 KB Output is correct
99 Correct 7 ms 9940 KB Output is correct
100 Correct 7 ms 9940 KB Output is correct
101 Correct 9 ms 9868 KB Output is correct
102 Correct 7 ms 9948 KB Output is correct
103 Correct 7 ms 9864 KB Output is correct
104 Correct 7 ms 9940 KB Output is correct
105 Correct 30 ms 13340 KB Output is correct
106 Correct 34 ms 13396 KB Output is correct
107 Correct 30 ms 13468 KB Output is correct
108 Correct 8 ms 10068 KB Output is correct
109 Correct 159 ms 9956 KB Output is correct
110 Correct 88 ms 9928 KB Output is correct
111 Correct 66 ms 9812 KB Output is correct
112 Correct 70 ms 9996 KB Output is correct
113 Correct 47 ms 9940 KB Output is correct
114 Correct 16 ms 11140 KB Output is correct
115 Correct 16 ms 10964 KB Output is correct
116 Correct 19 ms 11220 KB Output is correct
117 Correct 16 ms 11092 KB Output is correct
118 Correct 22 ms 11168 KB Output is correct
119 Correct 15 ms 10992 KB Output is correct
120 Correct 23 ms 12180 KB Output is correct
121 Correct 9 ms 10324 KB Output is correct
122 Correct 24 ms 12324 KB Output is correct
123 Correct 9 ms 10324 KB Output is correct
124 Correct 26 ms 12828 KB Output is correct
125 Correct 11 ms 10580 KB Output is correct
126 Correct 12 ms 10580 KB Output is correct
127 Correct 14 ms 10704 KB Output is correct
128 Correct 13 ms 10452 KB Output is correct
129 Correct 11 ms 10488 KB Output is correct
130 Correct 8 ms 10168 KB Output is correct
131 Correct 227 ms 10280 KB Output is correct
132 Correct 158 ms 10052 KB Output is correct
133 Correct 130 ms 10048 KB Output is correct
134 Correct 112 ms 10084 KB Output is correct
135 Correct 96 ms 10080 KB Output is correct
136 Correct 22 ms 11580 KB Output is correct
137 Correct 24 ms 11524 KB Output is correct
138 Correct 21 ms 11476 KB Output is correct
139 Correct 22 ms 11584 KB Output is correct
140 Correct 22 ms 11476 KB Output is correct
141 Correct 21 ms 11508 KB Output is correct
142 Correct 33 ms 13740 KB Output is correct
143 Correct 11 ms 10836 KB Output is correct
144 Correct 33 ms 13840 KB Output is correct
145 Correct 12 ms 10836 KB Output is correct
146 Correct 34 ms 13772 KB Output is correct
147 Correct 12 ms 10836 KB Output is correct
148 Correct 15 ms 11012 KB Output is correct
149 Correct 14 ms 10836 KB Output is correct
150 Correct 14 ms 10788 KB Output is correct
151 Correct 14 ms 10824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 9684 KB Output is correct
2 Correct 5 ms 9688 KB Output is correct
3 Correct 7 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 6 ms 9812 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9608 KB Output is correct
8 Correct 5 ms 9664 KB Output is correct
9 Correct 5 ms 9684 KB Output is correct
10 Correct 5 ms 9616 KB Output is correct
11 Correct 6 ms 9684 KB Output is correct
12 Correct 5 ms 9644 KB Output is correct
13 Correct 7 ms 9684 KB Output is correct
14 Correct 5 ms 9672 KB Output is correct
15 Correct 6 ms 9764 KB Output is correct
16 Correct 6 ms 9684 KB Output is correct
17 Correct 6 ms 9684 KB Output is correct
18 Correct 6 ms 9684 KB Output is correct
19 Correct 6 ms 9672 KB Output is correct
20 Correct 6 ms 9700 KB Output is correct
21 Correct 6 ms 9684 KB Output is correct
22 Correct 6 ms 9684 KB Output is correct
23 Correct 6 ms 9684 KB Output is correct
24 Correct 21 ms 13656 KB Output is correct
25 Correct 23 ms 13600 KB Output is correct
26 Correct 23 ms 13524 KB Output is correct
27 Correct 8 ms 10104 KB Output is correct
28 Correct 8 ms 10068 KB Output is correct
29 Correct 7 ms 9940 KB Output is correct
30 Correct 9 ms 9912 KB Output is correct
31 Correct 9 ms 9940 KB Output is correct
32 Correct 8 ms 9940 KB Output is correct
33 Correct 13 ms 11048 KB Output is correct
34 Correct 13 ms 11000 KB Output is correct
35 Correct 13 ms 11068 KB Output is correct
36 Correct 13 ms 11092 KB Output is correct
37 Correct 13 ms 11016 KB Output is correct
38 Correct 13 ms 11092 KB Output is correct
39 Correct 26 ms 14036 KB Output is correct
40 Correct 25 ms 14036 KB Output is correct
41 Correct 26 ms 14048 KB Output is correct
42 Correct 19 ms 11472 KB Output is correct
43 Correct 15 ms 10708 KB Output is correct
44 Correct 17 ms 11340 KB Output is correct
45 Correct 12 ms 10452 KB Output is correct
46 Correct 14 ms 10468 KB Output is correct
47 Correct 15 ms 10880 KB Output is correct
48 Correct 41 ms 19532 KB Output is correct
49 Correct 32 ms 15124 KB Output is correct
50 Correct 35 ms 17484 KB Output is correct
51 Correct 39 ms 17748 KB Output is correct
52 Correct 42 ms 17412 KB Output is correct
53 Correct 35 ms 15132 KB Output is correct
54 Correct 20 ms 11640 KB Output is correct
55 Correct 20 ms 11544 KB Output is correct
56 Correct 18 ms 11308 KB Output is correct
57 Correct 15 ms 10876 KB Output is correct
58 Correct 15 ms 10964 KB Output is correct
59 Correct 15 ms 10964 KB Output is correct
60 Correct 46 ms 20268 KB Output is correct
61 Correct 47 ms 20300 KB Output is correct
62 Correct 47 ms 20216 KB Output is correct
63 Correct 45 ms 20212 KB Output is correct
64 Correct 45 ms 20308 KB Output is correct
65 Correct 46 ms 20316 KB Output is correct
66 Correct 52 ms 19220 KB Output is correct
67 Correct 53 ms 19220 KB Output is correct
68 Correct 54 ms 19328 KB Output is correct
69 Correct 5 ms 9684 KB Output is correct
70 Correct 5 ms 9684 KB Output is correct
71 Correct 5 ms 9684 KB Output is correct
72 Correct 5 ms 9684 KB Output is correct
73 Correct 5 ms 9684 KB Output is correct
74 Correct 5 ms 9684 KB Output is correct
75 Correct 6 ms 9656 KB Output is correct
76 Correct 5 ms 9684 KB Output is correct
77 Correct 5 ms 9684 KB Output is correct
78 Correct 5 ms 9684 KB Output is correct
79 Correct 5 ms 9744 KB Output is correct
80 Correct 5 ms 9684 KB Output is correct
81 Correct 6 ms 9812 KB Output is correct
82 Correct 6 ms 9684 KB Output is correct
83 Correct 6 ms 9664 KB Output is correct
84 Correct 5 ms 9684 KB Output is correct
85 Correct 7 ms 9708 KB Output is correct
86 Correct 6 ms 9684 KB Output is correct
87 Correct 5 ms 9720 KB Output is correct
88 Correct 6 ms 9684 KB Output is correct
89 Correct 5 ms 9684 KB Output is correct
90 Correct 5 ms 9684 KB Output is correct
91 Correct 5 ms 9684 KB Output is correct
92 Correct 6 ms 9704 KB Output is correct
93 Correct 5 ms 9684 KB Output is correct
94 Correct 5 ms 9684 KB Output is correct
95 Correct 5 ms 9684 KB Output is correct
96 Correct 6 ms 9648 KB Output is correct
97 Correct 5 ms 9684 KB Output is correct
98 Correct 5 ms 9652 KB Output is correct
99 Correct 6 ms 9684 KB Output is correct
100 Correct 5 ms 9684 KB Output is correct
101 Correct 6 ms 9684 KB Output is correct
102 Correct 5 ms 9700 KB Output is correct
103 Correct 6 ms 9684 KB Output is correct
104 Correct 6 ms 9684 KB Output is correct
105 Correct 5 ms 9684 KB Output is correct
106 Correct 5 ms 9684 KB Output is correct
107 Correct 5 ms 9720 KB Output is correct
108 Correct 6 ms 9684 KB Output is correct
109 Correct 6 ms 9684 KB Output is correct
110 Correct 6 ms 9684 KB Output is correct
111 Correct 6 ms 9684 KB Output is correct
112 Correct 8 ms 9900 KB Output is correct
113 Correct 7 ms 9812 KB Output is correct
114 Correct 7 ms 9812 KB Output is correct
115 Correct 6 ms 9812 KB Output is correct
116 Correct 8 ms 9812 KB Output is correct
117 Correct 6 ms 9812 KB Output is correct
118 Correct 23 ms 12372 KB Output is correct
119 Correct 20 ms 12728 KB Output is correct
120 Correct 26 ms 13104 KB Output is correct
121 Correct 6 ms 9684 KB Output is correct
122 Correct 7 ms 9744 KB Output is correct
123 Correct 6 ms 9684 KB Output is correct
124 Correct 7 ms 9752 KB Output is correct
125 Correct 6 ms 9684 KB Output is correct
126 Correct 7 ms 9940 KB Output is correct
127 Correct 7 ms 9940 KB Output is correct
128 Correct 9 ms 9868 KB Output is correct
129 Correct 7 ms 9948 KB Output is correct
130 Correct 7 ms 9864 KB Output is correct
131 Correct 7 ms 9940 KB Output is correct
132 Correct 30 ms 13340 KB Output is correct
133 Correct 34 ms 13396 KB Output is correct
134 Correct 30 ms 13468 KB Output is correct
135 Correct 8 ms 10068 KB Output is correct
136 Correct 159 ms 9956 KB Output is correct
137 Correct 88 ms 9928 KB Output is correct
138 Correct 66 ms 9812 KB Output is correct
139 Correct 70 ms 9996 KB Output is correct
140 Correct 47 ms 9940 KB Output is correct
141 Correct 16 ms 11140 KB Output is correct
142 Correct 16 ms 10964 KB Output is correct
143 Correct 19 ms 11220 KB Output is correct
144 Correct 16 ms 11092 KB Output is correct
145 Correct 22 ms 11168 KB Output is correct
146 Correct 15 ms 10992 KB Output is correct
147 Correct 23 ms 12180 KB Output is correct
148 Correct 9 ms 10324 KB Output is correct
149 Correct 24 ms 12324 KB Output is correct
150 Correct 9 ms 10324 KB Output is correct
151 Correct 26 ms 12828 KB Output is correct
152 Correct 11 ms 10580 KB Output is correct
153 Correct 12 ms 10580 KB Output is correct
154 Correct 14 ms 10704 KB Output is correct
155 Correct 13 ms 10452 KB Output is correct
156 Correct 11 ms 10488 KB Output is correct
157 Correct 8 ms 10168 KB Output is correct
158 Correct 227 ms 10280 KB Output is correct
159 Correct 158 ms 10052 KB Output is correct
160 Correct 130 ms 10048 KB Output is correct
161 Correct 112 ms 10084 KB Output is correct
162 Correct 96 ms 10080 KB Output is correct
163 Correct 22 ms 11580 KB Output is correct
164 Correct 24 ms 11524 KB Output is correct
165 Correct 21 ms 11476 KB Output is correct
166 Correct 22 ms 11584 KB Output is correct
167 Correct 22 ms 11476 KB Output is correct
168 Correct 21 ms 11508 KB Output is correct
169 Correct 33 ms 13740 KB Output is correct
170 Correct 11 ms 10836 KB Output is correct
171 Correct 33 ms 13840 KB Output is correct
172 Correct 12 ms 10836 KB Output is correct
173 Correct 34 ms 13772 KB Output is correct
174 Correct 12 ms 10836 KB Output is correct
175 Correct 15 ms 11012 KB Output is correct
176 Correct 14 ms 10836 KB Output is correct
177 Correct 14 ms 10788 KB Output is correct
178 Correct 14 ms 10824 KB Output is correct
179 Correct 17 ms 10836 KB Output is correct
180 Correct 461 ms 10964 KB Output is correct
181 Correct 520 ms 10824 KB Output is correct
182 Correct 667 ms 11084 KB Output is correct
183 Correct 321 ms 10656 KB Output is correct
184 Correct 258 ms 10724 KB Output is correct
185 Correct 36 ms 13588 KB Output is correct
186 Correct 30 ms 15188 KB Output is correct
187 Correct 39 ms 14180 KB Output is correct
188 Correct 39 ms 13556 KB Output is correct
189 Correct 41 ms 14028 KB Output is correct
190 Correct 40 ms 14624 KB Output is correct
191 Correct 36 ms 14668 KB Output is correct
192 Correct 29 ms 12884 KB Output is correct
193 Correct 29 ms 12720 KB Output is correct
194 Correct 21 ms 11640 KB Output is correct
195 Correct 1161 ms 11680 KB Output is correct
196 Correct 785 ms 11328 KB Output is correct
197 Correct 650 ms 11256 KB Output is correct
198 Correct 562 ms 11340 KB Output is correct
199 Correct 513 ms 11424 KB Output is correct
200 Correct 66 ms 22096 KB Output is correct
201 Correct 66 ms 22092 KB Output is correct
202 Correct 63 ms 22084 KB Output is correct
203 Correct 68 ms 22080 KB Output is correct
204 Correct 66 ms 22148 KB Output is correct
205 Correct 66 ms 22140 KB Output is correct
206 Correct 67 ms 20940 KB Output is correct
207 Correct 53 ms 20588 KB Output is correct
208 Correct 65 ms 20848 KB Output is correct
209 Correct 54 ms 20560 KB Output is correct
210 Correct 64 ms 20792 KB Output is correct
211 Correct 54 ms 20624 KB Output is correct
212 Correct 57 ms 21480 KB Output is correct
213 Correct 55 ms 18476 KB Output is correct
214 Correct 55 ms 18036 KB Output is correct
215 Correct 55 ms 17868 KB Output is correct