답안 #764665

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
764665 2023-06-23T19:15:25 Z raysh07 벽 칠하기 (APIO20_paint) C++17
100 / 100
1245 ms 15864 KB
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 69;
int seg[4 * N];

void upd(int l, int r, int pos, int qp, int v){
    if (l == r){
        seg[pos] = v;
        return;
    }
    
    int mid = (l + r)/2;
    if (qp <= mid) upd(l, mid, pos*2, qp, v);
    else upd(mid + 1, r, pos*2 + 1, qp, v);
    
    seg[pos] = min(seg[pos * 2], seg[pos * 2 + 1]);
}

int query(int l, int r, int pos, int ql, int qr){
    if (l >= ql && r <= qr) return seg[pos];
    else if (l > qr || r < ql) return 1e8;
    
    int mid = (l + r)/2;
    return min(query(l, mid, pos*2, ql, qr), query(mid + 1, r, pos*2 + 1, ql, qr));
}

int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int>> b) {
    vector<vector<int>> adj(k);
    for (int i = 0; i < m; i++){
        for (auto x : b[i]){
            adj[x].push_back(i);
        }
    }
    
    //adj[x] size is atmost sqrt(4e5) = 650 
    vector<bool> can(n + 1, false);
    vector <int> mp(m, 0);
    for (int i = 0; i < n; i++){
        //if painter x can do y, then increase frequency of x - y mod m ofc 
        //then a thing can be done if and only if frequency = m 
        int y = c[i];
        
        if (i >= m){
            for (auto x : adj[c[i - m]]){
                
                int lol = (x - i) % m;
                lol = (lol + m) % m;
                
              //  cout << "SUB " << i - m << " " << " COLOUR " << c[i - m] << " PAINTER " << x << " DIFF " << lol << "\n";
                mp[lol]--;
            }
        }
        
        for (auto x : adj[y]){
            int lol = (x - i) % m;
            lol = (lol + m) % m;
            
          //  cout << "ADD " << i << " " << " COLOUR " << y << " PAINTER " << x << " DIFF " << lol << "\n";
            mp[lol]++;
            if (mp[lol] == m) {
              //  cout << "NOOOO\n";
                can[i + 1] = true;
            }
        }
    }
    
    vector <int> dp(n + 1, 1e8);
    dp[0] = 0;
    
    for (int i = 0; i <= n; i++) upd(0, n, 1, i, dp[i]);
    
    for (int i = 1; i <= n; i++){
        if (can[i]){
            dp[i] = min(dp[i], 1 + query(0, n, 1, i - m, i - 1));
        }
        
        upd(0, n, 1, i, dp[i]);
    }
    
    if (dp[n] > n) return -1;
    else return dp[n];
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
14 Correct 3 ms 2644 KB Output is correct
15 Correct 2 ms 2640 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 2 ms 2644 KB Output is correct
19 Correct 2 ms 2620 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 14 ms 6476 KB Output is correct
23 Correct 14 ms 6484 KB Output is correct
24 Correct 18 ms 6568 KB Output is correct
25 Correct 8 ms 724 KB Output is correct
26 Correct 8 ms 796 KB Output is correct
27 Correct 7 ms 724 KB Output is correct
28 Correct 6 ms 800 KB Output is correct
29 Correct 5 ms 768 KB Output is correct
30 Correct 6 ms 724 KB Output is correct
31 Correct 13 ms 3968 KB Output is correct
32 Correct 14 ms 4052 KB Output is correct
33 Correct 13 ms 4052 KB Output is correct
34 Correct 16 ms 4044 KB Output is correct
35 Correct 13 ms 4052 KB Output is correct
36 Correct 15 ms 4052 KB Output is correct
37 Correct 21 ms 7164 KB Output is correct
38 Correct 26 ms 7172 KB Output is correct
39 Correct 21 ms 7232 KB Output is correct
40 Correct 37 ms 2300 KB Output is correct
41 Correct 23 ms 1492 KB Output is correct
42 Correct 36 ms 2472 KB Output is correct
43 Correct 20 ms 1656 KB Output is correct
44 Correct 17 ms 1444 KB Output is correct
45 Correct 29 ms 2516 KB Output is correct
46 Correct 58 ms 13192 KB Output is correct
47 Correct 44 ms 8276 KB Output is correct
48 Correct 35 ms 10612 KB Output is correct
49 Correct 39 ms 10776 KB Output is correct
50 Correct 40 ms 11096 KB Output is correct
51 Correct 50 ms 8424 KB Output is correct
52 Correct 41 ms 2512 KB Output is correct
53 Correct 43 ms 2616 KB Output is correct
54 Correct 36 ms 2472 KB Output is correct
55 Correct 30 ms 2520 KB Output is correct
56 Correct 29 ms 2488 KB Output is correct
57 Correct 29 ms 2512 KB Output is correct
58 Correct 68 ms 13988 KB Output is correct
59 Correct 69 ms 13980 KB Output is correct
60 Correct 71 ms 14064 KB Output is correct
61 Correct 67 ms 14028 KB Output is correct
62 Correct 67 ms 14008 KB Output is correct
63 Correct 65 ms 14028 KB Output is correct
64 Correct 54 ms 13184 KB Output is correct
65 Correct 54 ms 13220 KB Output is correct
66 Correct 53 ms 13224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
14 Correct 3 ms 2644 KB Output is correct
15 Correct 2 ms 2640 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 2 ms 2644 KB Output is correct
19 Correct 2 ms 2620 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 2260 KB Output is correct
34 Correct 1 ms 1748 KB Output is correct
35 Correct 1 ms 1620 KB Output is correct
36 Correct 1 ms 2644 KB Output is correct
37 Correct 1 ms 2132 KB Output is correct
38 Correct 2 ms 2388 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 2132 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 1 ms 2516 KB Output is correct
43 Correct 1 ms 2388 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 2 ms 2644 KB Output is correct
51 Correct 2 ms 2644 KB Output is correct
52 Correct 1 ms 2644 KB Output is correct
53 Correct 2 ms 2644 KB Output is correct
54 Correct 1 ms 2644 KB Output is correct
55 Correct 2 ms 2644 KB Output is correct
56 Correct 2 ms 2644 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 2 ms 2644 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 2 ms 2644 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 2 ms 2644 KB Output is correct
16 Correct 3 ms 2644 KB Output is correct
17 Correct 2 ms 2640 KB Output is correct
18 Correct 2 ms 2644 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2620 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 14 ms 6476 KB Output is correct
25 Correct 14 ms 6484 KB Output is correct
26 Correct 18 ms 6568 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 1 ms 2260 KB Output is correct
37 Correct 1 ms 1748 KB Output is correct
38 Correct 1 ms 1620 KB Output is correct
39 Correct 1 ms 2644 KB Output is correct
40 Correct 1 ms 2132 KB Output is correct
41 Correct 2 ms 2388 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 1 ms 2132 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 2516 KB Output is correct
46 Correct 1 ms 2388 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 2 ms 2644 KB Output is correct
54 Correct 2 ms 2644 KB Output is correct
55 Correct 1 ms 2644 KB Output is correct
56 Correct 2 ms 2644 KB Output is correct
57 Correct 1 ms 2644 KB Output is correct
58 Correct 2 ms 2644 KB Output is correct
59 Correct 2 ms 2644 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 2 ms 2644 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 2 ms 2644 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 2 ms 340 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 2 ms 2388 KB Output is correct
71 Correct 3 ms 2132 KB Output is correct
72 Correct 3 ms 1876 KB Output is correct
73 Correct 2 ms 2072 KB Output is correct
74 Correct 2 ms 2260 KB Output is correct
75 Correct 2 ms 2772 KB Output is correct
76 Correct 15 ms 4564 KB Output is correct
77 Correct 19 ms 5340 KB Output is correct
78 Correct 19 ms 5976 KB Output is correct
79 Correct 2 ms 340 KB Output is correct
80 Correct 2 ms 340 KB Output is correct
81 Correct 2 ms 340 KB Output is correct
82 Correct 2 ms 340 KB Output is correct
83 Correct 2 ms 340 KB Output is correct
84 Correct 3 ms 2900 KB Output is correct
85 Correct 3 ms 2868 KB Output is correct
86 Correct 3 ms 2900 KB Output is correct
87 Correct 3 ms 2900 KB Output is correct
88 Correct 3 ms 2900 KB Output is correct
89 Correct 3 ms 2900 KB Output is correct
90 Correct 21 ms 6336 KB Output is correct
91 Correct 21 ms 6364 KB Output is correct
92 Correct 22 ms 6324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 2 ms 2644 KB Output is correct
16 Correct 3 ms 2644 KB Output is correct
17 Correct 2 ms 2640 KB Output is correct
18 Correct 2 ms 2644 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2620 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 14 ms 6476 KB Output is correct
25 Correct 14 ms 6484 KB Output is correct
26 Correct 18 ms 6568 KB Output is correct
27 Correct 8 ms 724 KB Output is correct
28 Correct 8 ms 796 KB Output is correct
29 Correct 7 ms 724 KB Output is correct
30 Correct 6 ms 800 KB Output is correct
31 Correct 5 ms 768 KB Output is correct
32 Correct 6 ms 724 KB Output is correct
33 Correct 13 ms 3968 KB Output is correct
34 Correct 14 ms 4052 KB Output is correct
35 Correct 13 ms 4052 KB Output is correct
36 Correct 16 ms 4044 KB Output is correct
37 Correct 13 ms 4052 KB Output is correct
38 Correct 15 ms 4052 KB Output is correct
39 Correct 21 ms 7164 KB Output is correct
40 Correct 26 ms 7172 KB Output is correct
41 Correct 21 ms 7232 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 0 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 1 ms 2260 KB Output is correct
52 Correct 1 ms 1748 KB Output is correct
53 Correct 1 ms 1620 KB Output is correct
54 Correct 1 ms 2644 KB Output is correct
55 Correct 1 ms 2132 KB Output is correct
56 Correct 2 ms 2388 KB Output is correct
57 Correct 1 ms 212 KB Output is correct
58 Correct 1 ms 2132 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 2516 KB Output is correct
61 Correct 1 ms 2388 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 212 KB Output is correct
68 Correct 2 ms 2644 KB Output is correct
69 Correct 2 ms 2644 KB Output is correct
70 Correct 1 ms 2644 KB Output is correct
71 Correct 2 ms 2644 KB Output is correct
72 Correct 1 ms 2644 KB Output is correct
73 Correct 2 ms 2644 KB Output is correct
74 Correct 2 ms 2644 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 2 ms 2644 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 2 ms 2644 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 212 KB Output is correct
81 Correct 1 ms 212 KB Output is correct
82 Correct 2 ms 340 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 2 ms 2388 KB Output is correct
86 Correct 3 ms 2132 KB Output is correct
87 Correct 3 ms 1876 KB Output is correct
88 Correct 2 ms 2072 KB Output is correct
89 Correct 2 ms 2260 KB Output is correct
90 Correct 2 ms 2772 KB Output is correct
91 Correct 15 ms 4564 KB Output is correct
92 Correct 19 ms 5340 KB Output is correct
93 Correct 19 ms 5976 KB Output is correct
94 Correct 2 ms 340 KB Output is correct
95 Correct 2 ms 340 KB Output is correct
96 Correct 2 ms 340 KB Output is correct
97 Correct 2 ms 340 KB Output is correct
98 Correct 2 ms 340 KB Output is correct
99 Correct 3 ms 2900 KB Output is correct
100 Correct 3 ms 2868 KB Output is correct
101 Correct 3 ms 2900 KB Output is correct
102 Correct 3 ms 2900 KB Output is correct
103 Correct 3 ms 2900 KB Output is correct
104 Correct 3 ms 2900 KB Output is correct
105 Correct 21 ms 6336 KB Output is correct
106 Correct 21 ms 6364 KB Output is correct
107 Correct 22 ms 6324 KB Output is correct
108 Correct 8 ms 724 KB Output is correct
109 Correct 167 ms 604 KB Output is correct
110 Correct 88 ms 600 KB Output is correct
111 Correct 67 ms 604 KB Output is correct
112 Correct 77 ms 652 KB Output is correct
113 Correct 51 ms 624 KB Output is correct
114 Correct 14 ms 4052 KB Output is correct
115 Correct 14 ms 3672 KB Output is correct
116 Correct 18 ms 4180 KB Output is correct
117 Correct 13 ms 3264 KB Output is correct
118 Correct 15 ms 3904 KB Output is correct
119 Correct 14 ms 3756 KB Output is correct
120 Correct 16 ms 4332 KB Output is correct
121 Correct 7 ms 1236 KB Output is correct
122 Correct 18 ms 4436 KB Output is correct
123 Correct 7 ms 1108 KB Output is correct
124 Correct 22 ms 5556 KB Output is correct
125 Correct 12 ms 1676 KB Output is correct
126 Correct 8 ms 2516 KB Output is correct
127 Correct 11 ms 3540 KB Output is correct
128 Correct 7 ms 2944 KB Output is correct
129 Correct 7 ms 2388 KB Output is correct
130 Correct 8 ms 796 KB Output is correct
131 Correct 236 ms 784 KB Output is correct
132 Correct 167 ms 804 KB Output is correct
133 Correct 136 ms 832 KB Output is correct
134 Correct 119 ms 832 KB Output is correct
135 Correct 107 ms 844 KB Output is correct
136 Correct 20 ms 4484 KB Output is correct
137 Correct 24 ms 4560 KB Output is correct
138 Correct 20 ms 4488 KB Output is correct
139 Correct 20 ms 4504 KB Output is correct
140 Correct 20 ms 4540 KB Output is correct
141 Correct 20 ms 4524 KB Output is correct
142 Correct 27 ms 7008 KB Output is correct
143 Correct 14 ms 1896 KB Output is correct
144 Correct 27 ms 7052 KB Output is correct
145 Correct 13 ms 1884 KB Output is correct
146 Correct 26 ms 6996 KB Output is correct
147 Correct 13 ms 1876 KB Output is correct
148 Correct 13 ms 4160 KB Output is correct
149 Correct 13 ms 4052 KB Output is correct
150 Correct 11 ms 3964 KB Output is correct
151 Correct 11 ms 3924 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 2 ms 2644 KB Output is correct
16 Correct 3 ms 2644 KB Output is correct
17 Correct 2 ms 2640 KB Output is correct
18 Correct 2 ms 2644 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2620 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 14 ms 6476 KB Output is correct
25 Correct 14 ms 6484 KB Output is correct
26 Correct 18 ms 6568 KB Output is correct
27 Correct 8 ms 724 KB Output is correct
28 Correct 8 ms 796 KB Output is correct
29 Correct 7 ms 724 KB Output is correct
30 Correct 6 ms 800 KB Output is correct
31 Correct 5 ms 768 KB Output is correct
32 Correct 6 ms 724 KB Output is correct
33 Correct 13 ms 3968 KB Output is correct
34 Correct 14 ms 4052 KB Output is correct
35 Correct 13 ms 4052 KB Output is correct
36 Correct 16 ms 4044 KB Output is correct
37 Correct 13 ms 4052 KB Output is correct
38 Correct 15 ms 4052 KB Output is correct
39 Correct 21 ms 7164 KB Output is correct
40 Correct 26 ms 7172 KB Output is correct
41 Correct 21 ms 7232 KB Output is correct
42 Correct 37 ms 2300 KB Output is correct
43 Correct 23 ms 1492 KB Output is correct
44 Correct 36 ms 2472 KB Output is correct
45 Correct 20 ms 1656 KB Output is correct
46 Correct 17 ms 1444 KB Output is correct
47 Correct 29 ms 2516 KB Output is correct
48 Correct 58 ms 13192 KB Output is correct
49 Correct 44 ms 8276 KB Output is correct
50 Correct 35 ms 10612 KB Output is correct
51 Correct 39 ms 10776 KB Output is correct
52 Correct 40 ms 11096 KB Output is correct
53 Correct 50 ms 8424 KB Output is correct
54 Correct 41 ms 2512 KB Output is correct
55 Correct 43 ms 2616 KB Output is correct
56 Correct 36 ms 2472 KB Output is correct
57 Correct 30 ms 2520 KB Output is correct
58 Correct 29 ms 2488 KB Output is correct
59 Correct 29 ms 2512 KB Output is correct
60 Correct 68 ms 13988 KB Output is correct
61 Correct 69 ms 13980 KB Output is correct
62 Correct 71 ms 14064 KB Output is correct
63 Correct 67 ms 14028 KB Output is correct
64 Correct 67 ms 14008 KB Output is correct
65 Correct 65 ms 14028 KB Output is correct
66 Correct 54 ms 13184 KB Output is correct
67 Correct 54 ms 13220 KB Output is correct
68 Correct 53 ms 13224 KB Output is correct
69 Correct 0 ms 212 KB Output is correct
70 Correct 0 ms 212 KB Output is correct
71 Correct 0 ms 212 KB Output is correct
72 Correct 1 ms 212 KB Output is correct
73 Correct 1 ms 212 KB Output is correct
74 Correct 0 ms 212 KB Output is correct
75 Correct 1 ms 212 KB Output is correct
76 Correct 1 ms 212 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 1 ms 2260 KB Output is correct
79 Correct 1 ms 1748 KB Output is correct
80 Correct 1 ms 1620 KB Output is correct
81 Correct 1 ms 2644 KB Output is correct
82 Correct 1 ms 2132 KB Output is correct
83 Correct 2 ms 2388 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 1 ms 2132 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 1 ms 2516 KB Output is correct
88 Correct 1 ms 2388 KB Output is correct
89 Correct 1 ms 212 KB Output is correct
90 Correct 1 ms 212 KB Output is correct
91 Correct 1 ms 212 KB Output is correct
92 Correct 1 ms 212 KB Output is correct
93 Correct 1 ms 212 KB Output is correct
94 Correct 1 ms 212 KB Output is correct
95 Correct 2 ms 2644 KB Output is correct
96 Correct 2 ms 2644 KB Output is correct
97 Correct 1 ms 2644 KB Output is correct
98 Correct 2 ms 2644 KB Output is correct
99 Correct 1 ms 2644 KB Output is correct
100 Correct 2 ms 2644 KB Output is correct
101 Correct 2 ms 2644 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 2 ms 2644 KB Output is correct
104 Correct 1 ms 340 KB Output is correct
105 Correct 2 ms 2644 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 212 KB Output is correct
108 Correct 1 ms 212 KB Output is correct
109 Correct 2 ms 340 KB Output is correct
110 Correct 1 ms 212 KB Output is correct
111 Correct 1 ms 212 KB Output is correct
112 Correct 2 ms 2388 KB Output is correct
113 Correct 3 ms 2132 KB Output is correct
114 Correct 3 ms 1876 KB Output is correct
115 Correct 2 ms 2072 KB Output is correct
116 Correct 2 ms 2260 KB Output is correct
117 Correct 2 ms 2772 KB Output is correct
118 Correct 15 ms 4564 KB Output is correct
119 Correct 19 ms 5340 KB Output is correct
120 Correct 19 ms 5976 KB Output is correct
121 Correct 2 ms 340 KB Output is correct
122 Correct 2 ms 340 KB Output is correct
123 Correct 2 ms 340 KB Output is correct
124 Correct 2 ms 340 KB Output is correct
125 Correct 2 ms 340 KB Output is correct
126 Correct 3 ms 2900 KB Output is correct
127 Correct 3 ms 2868 KB Output is correct
128 Correct 3 ms 2900 KB Output is correct
129 Correct 3 ms 2900 KB Output is correct
130 Correct 3 ms 2900 KB Output is correct
131 Correct 3 ms 2900 KB Output is correct
132 Correct 21 ms 6336 KB Output is correct
133 Correct 21 ms 6364 KB Output is correct
134 Correct 22 ms 6324 KB Output is correct
135 Correct 8 ms 724 KB Output is correct
136 Correct 167 ms 604 KB Output is correct
137 Correct 88 ms 600 KB Output is correct
138 Correct 67 ms 604 KB Output is correct
139 Correct 77 ms 652 KB Output is correct
140 Correct 51 ms 624 KB Output is correct
141 Correct 14 ms 4052 KB Output is correct
142 Correct 14 ms 3672 KB Output is correct
143 Correct 18 ms 4180 KB Output is correct
144 Correct 13 ms 3264 KB Output is correct
145 Correct 15 ms 3904 KB Output is correct
146 Correct 14 ms 3756 KB Output is correct
147 Correct 16 ms 4332 KB Output is correct
148 Correct 7 ms 1236 KB Output is correct
149 Correct 18 ms 4436 KB Output is correct
150 Correct 7 ms 1108 KB Output is correct
151 Correct 22 ms 5556 KB Output is correct
152 Correct 12 ms 1676 KB Output is correct
153 Correct 8 ms 2516 KB Output is correct
154 Correct 11 ms 3540 KB Output is correct
155 Correct 7 ms 2944 KB Output is correct
156 Correct 7 ms 2388 KB Output is correct
157 Correct 8 ms 796 KB Output is correct
158 Correct 236 ms 784 KB Output is correct
159 Correct 167 ms 804 KB Output is correct
160 Correct 136 ms 832 KB Output is correct
161 Correct 119 ms 832 KB Output is correct
162 Correct 107 ms 844 KB Output is correct
163 Correct 20 ms 4484 KB Output is correct
164 Correct 24 ms 4560 KB Output is correct
165 Correct 20 ms 4488 KB Output is correct
166 Correct 20 ms 4504 KB Output is correct
167 Correct 20 ms 4540 KB Output is correct
168 Correct 20 ms 4524 KB Output is correct
169 Correct 27 ms 7008 KB Output is correct
170 Correct 14 ms 1896 KB Output is correct
171 Correct 27 ms 7052 KB Output is correct
172 Correct 13 ms 1884 KB Output is correct
173 Correct 26 ms 6996 KB Output is correct
174 Correct 13 ms 1876 KB Output is correct
175 Correct 13 ms 4160 KB Output is correct
176 Correct 13 ms 4052 KB Output is correct
177 Correct 11 ms 3964 KB Output is correct
178 Correct 11 ms 3924 KB Output is correct
179 Correct 27 ms 1468 KB Output is correct
180 Correct 507 ms 1424 KB Output is correct
181 Correct 549 ms 2276 KB Output is correct
182 Correct 694 ms 2816 KB Output is correct
183 Correct 342 ms 1860 KB Output is correct
184 Correct 281 ms 1704 KB Output is correct
185 Correct 39 ms 6476 KB Output is correct
186 Correct 43 ms 8584 KB Output is correct
187 Correct 58 ms 7704 KB Output is correct
188 Correct 43 ms 7884 KB Output is correct
189 Correct 59 ms 8032 KB Output is correct
190 Correct 43 ms 8492 KB Output is correct
191 Correct 66 ms 8660 KB Output is correct
192 Correct 32 ms 7044 KB Output is correct
193 Correct 43 ms 6312 KB Output is correct
194 Correct 44 ms 2600 KB Output is correct
195 Correct 1245 ms 2788 KB Output is correct
196 Correct 872 ms 2812 KB Output is correct
197 Correct 705 ms 2844 KB Output is correct
198 Correct 612 ms 2888 KB Output is correct
199 Correct 553 ms 2892 KB Output is correct
200 Correct 79 ms 15820 KB Output is correct
201 Correct 80 ms 15864 KB Output is correct
202 Correct 77 ms 15792 KB Output is correct
203 Correct 82 ms 15812 KB Output is correct
204 Correct 78 ms 15788 KB Output is correct
205 Correct 82 ms 15848 KB Output is correct
206 Correct 77 ms 14800 KB Output is correct
207 Correct 68 ms 14168 KB Output is correct
208 Correct 64 ms 14792 KB Output is correct
209 Correct 67 ms 14156 KB Output is correct
210 Correct 76 ms 14764 KB Output is correct
211 Correct 71 ms 14068 KB Output is correct
212 Correct 64 ms 15732 KB Output is correct
213 Correct 57 ms 12492 KB Output is correct
214 Correct 60 ms 12000 KB Output is correct
215 Correct 55 ms 11852 KB Output is correct