답안 #572009

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
572009 2022-06-03T09:09:33 Z SlavicG 벽 칠하기 (APIO20_paint) C++17
40 / 100
1500 ms 76436 KB
#include "bits/stdc++.h"
using namespace std;
 
#define ll long long
 
#define       forn(i,n)              for(int i=0;i<n;i++)
#define          all(v)              v.begin(), v.end()
#define         rall(v)              v.rbegin(),v.rend()
 
#define            pb                push_back
#define          sz(a)               (int)a.size()

int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int>> b) {
    vector<int> p[k + 1];

    for(int i = 0; i < m; ++i) {
        for(auto x: b[i]) {
            p[x].pb(i);
        }
    }  
    for(int i = 0; i <= k; ++i) {
        sort(all(p[i]));
        p[i].erase(unique(all(p[i])), p[i].end());
    }

    vector<vector<int>> mx(n);

    for(auto x: p[c[n - 1]]) mx[n - 1].pb(1);

    for(int i = n - 2; i >= 0; --i) {
        for(auto x: p[c[i]]) {
            int newval = x + 1;
            if(newval >= m) newval -= m;
            bool ok = false;
            for(int j = 0; j < sz(p[c[i + 1]]); ++j) {
                if(p[c[i + 1]][j] == newval) {
                    mx[i].pb(mx[i + 1][j] + 1);
                    ok = true;
                    break;
                }
            }
            if(!ok) mx[i].pb(1);
        }
    }

    vector<bool> can(n, false);
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < sz(mx[i]); ++j) {
            if(mx[i][j] >= m) can[i] = true;
        }
    }


    set<int> good;
    forn(i, n) if(can[i]) good.insert(i); 
    if(good.empty()) return -1;
    if(!can[0]) return -1;
    int lst = -100000000, ans = 0;
    for(int i = 0; i < n; ++i) {
        if(lst + m - 1 >= i) continue;
        ++ans;
        if(can[i]) {
            lst = i;
        } else {
            auto it = good.lower_bound(i);
            if(it == good.begin()) return -1;
            --it;
            if(*it + m - 1 < i) return -1;
            lst = *it;
        }
    }
    return ans;
}

/*
void solve() {  
    int n, m, k; cin >> n >> m >> k;
    vector<int> c(n); forn(i, n) cin >> c[i];
    vector<int> a(m); forn(i, m) cin >> a[i];
    vector<vector<int>> b(m);
    for(int i = 0; i < m; ++i) {
        b[i].resize(a[i]);
        for(int j = 0; j < a[i]; ++j) {
            cin >> b[i][j];
        }
    }
    cout << minimumInstructions(n, m, k, c, a, b) << "\n";
} 
     
int32_t main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t = 1;
    //cin >> t;
    while(t--) {
        solve();
    }
}   
*/

/*
8 3 5
3 3 1 3 4 4 2 2
3 2 2
0 1 2
2 3
3 4
*/

Compilation message

paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:28:14: warning: unused variable 'x' [-Wunused-variable]
   28 |     for(auto x: p[c[n - 1]]) mx[n - 1].pb(1);
      |              ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 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 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 296 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 316 KB Output is correct
13 Correct 2 ms 2608 KB Output is correct
14 Correct 2 ms 2644 KB Output is correct
15 Correct 2 ms 2636 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 2732 KB Output is correct
19 Correct 3 ms 2644 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 29 ms 6812 KB Output is correct
23 Correct 20 ms 6760 KB Output is correct
24 Correct 21 ms 6720 KB Output is correct
25 Correct 7 ms 2516 KB Output is correct
26 Correct 6 ms 2516 KB Output is correct
27 Correct 5 ms 2004 KB Output is correct
28 Correct 6 ms 1620 KB Output is correct
29 Correct 3 ms 1492 KB Output is correct
30 Correct 3 ms 1492 KB Output is correct
31 Correct 12 ms 5812 KB Output is correct
32 Correct 20 ms 5844 KB Output is correct
33 Correct 14 ms 5708 KB Output is correct
34 Correct 18 ms 5680 KB Output is correct
35 Correct 13 ms 5668 KB Output is correct
36 Correct 13 ms 5736 KB Output is correct
37 Correct 25 ms 8012 KB Output is correct
38 Correct 25 ms 7972 KB Output is correct
39 Correct 26 ms 7952 KB Output is correct
40 Correct 30 ms 10248 KB Output is correct
41 Correct 18 ms 6484 KB Output is correct
42 Correct 26 ms 8780 KB Output is correct
43 Correct 12 ms 4788 KB Output is correct
44 Correct 10 ms 4160 KB Output is correct
45 Correct 20 ms 6612 KB Output is correct
46 Correct 61 ms 18348 KB Output is correct
47 Correct 35 ms 12108 KB Output is correct
48 Correct 34 ms 13388 KB Output is correct
49 Correct 46 ms 13512 KB Output is correct
50 Correct 46 ms 13676 KB Output is correct
51 Correct 45 ms 11264 KB Output is correct
52 Correct 33 ms 11312 KB Output is correct
53 Correct 34 ms 11488 KB Output is correct
54 Correct 27 ms 9052 KB Output is correct
55 Correct 17 ms 7252 KB Output is correct
56 Correct 16 ms 6760 KB Output is correct
57 Correct 15 ms 6760 KB Output is correct
58 Correct 65 ms 20372 KB Output is correct
59 Correct 69 ms 20556 KB Output is correct
60 Correct 61 ms 20392 KB Output is correct
61 Correct 64 ms 20508 KB Output is correct
62 Correct 69 ms 20472 KB Output is correct
63 Correct 67 ms 20556 KB Output is correct
64 Correct 62 ms 17352 KB Output is correct
65 Correct 65 ms 17252 KB Output is correct
66 Correct 59 ms 17268 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 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 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 296 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 316 KB Output is correct
13 Correct 2 ms 2608 KB Output is correct
14 Correct 2 ms 2644 KB Output is correct
15 Correct 2 ms 2636 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 2732 KB Output is correct
19 Correct 3 ms 2644 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 1 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 340 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 2 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 3 ms 2644 KB Output is correct
37 Correct 2 ms 2132 KB Output is correct
38 Correct 2 ms 2388 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 2004 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 2 ms 2516 KB Output is correct
43 Correct 2 ms 2388 KB Output is correct
44 Correct 0 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 3 ms 2660 KB Output is correct
51 Correct 2 ms 2644 KB Output is correct
52 Correct 3 ms 2644 KB Output is correct
53 Correct 3 ms 2644 KB Output is correct
54 Correct 2 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 380 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 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 1 ms 212 KB Output is correct
6 Correct 1 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 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 296 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 316 KB Output is correct
15 Correct 2 ms 2608 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2636 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 2732 KB Output is correct
21 Correct 3 ms 2644 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 29 ms 6812 KB Output is correct
25 Correct 20 ms 6760 KB Output is correct
26 Correct 21 ms 6720 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 340 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 2 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 3 ms 2644 KB Output is correct
40 Correct 2 ms 2132 KB Output is correct
41 Correct 2 ms 2388 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 2004 KB Output is correct
44 Correct 0 ms 340 KB Output is correct
45 Correct 2 ms 2516 KB Output is correct
46 Correct 2 ms 2388 KB Output is correct
47 Correct 0 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 3 ms 2660 KB Output is correct
54 Correct 2 ms 2644 KB Output is correct
55 Correct 3 ms 2644 KB Output is correct
56 Correct 3 ms 2644 KB Output is correct
57 Correct 2 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 380 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 4 ms 584 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 3 ms 596 KB Output is correct
68 Correct 2 ms 596 KB Output is correct
69 Correct 5 ms 572 KB Output is correct
70 Correct 3 ms 2516 KB Output is correct
71 Correct 5 ms 2132 KB Output is correct
72 Correct 3 ms 1876 KB Output is correct
73 Correct 3 ms 2004 KB Output is correct
74 Correct 5 ms 2260 KB Output is correct
75 Correct 3 ms 2772 KB Output is correct
76 Correct 19 ms 4552 KB Output is correct
77 Correct 21 ms 5400 KB Output is correct
78 Correct 25 ms 6032 KB Output is correct
79 Correct 7 ms 852 KB Output is correct
80 Correct 7 ms 784 KB Output is correct
81 Correct 7 ms 852 KB Output is correct
82 Correct 7 ms 852 KB Output is correct
83 Correct 7 ms 780 KB Output is correct
84 Correct 4 ms 2880 KB Output is correct
85 Correct 4 ms 2900 KB Output is correct
86 Correct 5 ms 2900 KB Output is correct
87 Correct 4 ms 2900 KB Output is correct
88 Correct 4 ms 2900 KB Output is correct
89 Correct 4 ms 2900 KB Output is correct
90 Correct 29 ms 6388 KB Output is correct
91 Correct 31 ms 6348 KB Output is correct
92 Correct 39 ms 6352 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 1 ms 212 KB Output is correct
6 Correct 1 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 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 296 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 316 KB Output is correct
15 Correct 2 ms 2608 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2636 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 2732 KB Output is correct
21 Correct 3 ms 2644 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 29 ms 6812 KB Output is correct
25 Correct 20 ms 6760 KB Output is correct
26 Correct 21 ms 6720 KB Output is correct
27 Correct 7 ms 2516 KB Output is correct
28 Correct 6 ms 2516 KB Output is correct
29 Correct 5 ms 2004 KB Output is correct
30 Correct 6 ms 1620 KB Output is correct
31 Correct 3 ms 1492 KB Output is correct
32 Correct 3 ms 1492 KB Output is correct
33 Correct 12 ms 5812 KB Output is correct
34 Correct 20 ms 5844 KB Output is correct
35 Correct 14 ms 5708 KB Output is correct
36 Correct 18 ms 5680 KB Output is correct
37 Correct 13 ms 5668 KB Output is correct
38 Correct 13 ms 5736 KB Output is correct
39 Correct 25 ms 8012 KB Output is correct
40 Correct 25 ms 7972 KB Output is correct
41 Correct 26 ms 7952 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 340 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 340 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 2 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 3 ms 2644 KB Output is correct
55 Correct 2 ms 2132 KB Output is correct
56 Correct 2 ms 2388 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 2004 KB Output is correct
59 Correct 0 ms 340 KB Output is correct
60 Correct 2 ms 2516 KB Output is correct
61 Correct 2 ms 2388 KB Output is correct
62 Correct 0 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 3 ms 2660 KB Output is correct
69 Correct 2 ms 2644 KB Output is correct
70 Correct 3 ms 2644 KB Output is correct
71 Correct 3 ms 2644 KB Output is correct
72 Correct 2 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 380 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 4 ms 584 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 3 ms 596 KB Output is correct
83 Correct 2 ms 596 KB Output is correct
84 Correct 5 ms 572 KB Output is correct
85 Correct 3 ms 2516 KB Output is correct
86 Correct 5 ms 2132 KB Output is correct
87 Correct 3 ms 1876 KB Output is correct
88 Correct 3 ms 2004 KB Output is correct
89 Correct 5 ms 2260 KB Output is correct
90 Correct 3 ms 2772 KB Output is correct
91 Correct 19 ms 4552 KB Output is correct
92 Correct 21 ms 5400 KB Output is correct
93 Correct 25 ms 6032 KB Output is correct
94 Correct 7 ms 852 KB Output is correct
95 Correct 7 ms 784 KB Output is correct
96 Correct 7 ms 852 KB Output is correct
97 Correct 7 ms 852 KB Output is correct
98 Correct 7 ms 780 KB Output is correct
99 Correct 4 ms 2880 KB Output is correct
100 Correct 4 ms 2900 KB Output is correct
101 Correct 5 ms 2900 KB Output is correct
102 Correct 4 ms 2900 KB Output is correct
103 Correct 4 ms 2900 KB Output is correct
104 Correct 4 ms 2900 KB Output is correct
105 Correct 29 ms 6388 KB Output is correct
106 Correct 31 ms 6348 KB Output is correct
107 Correct 39 ms 6352 KB Output is correct
108 Correct 8 ms 2388 KB Output is correct
109 Correct 1239 ms 59796 KB Output is correct
110 Correct 602 ms 25708 KB Output is correct
111 Correct 454 ms 23980 KB Output is correct
112 Correct 486 ms 31892 KB Output is correct
113 Correct 286 ms 15932 KB Output is correct
114 Correct 15 ms 5016 KB Output is correct
115 Correct 15 ms 4636 KB Output is correct
116 Correct 26 ms 5552 KB Output is correct
117 Correct 17 ms 4248 KB Output is correct
118 Correct 19 ms 5100 KB Output is correct
119 Correct 15 ms 4948 KB Output is correct
120 Correct 24 ms 4692 KB Output is correct
121 Correct 7 ms 2140 KB Output is correct
122 Correct 22 ms 4816 KB Output is correct
123 Correct 7 ms 2132 KB Output is correct
124 Correct 26 ms 6128 KB Output is correct
125 Correct 11 ms 3196 KB Output is correct
126 Correct 9 ms 3324 KB Output is correct
127 Correct 10 ms 4168 KB Output is correct
128 Correct 8 ms 3520 KB Output is correct
129 Correct 7 ms 3028 KB Output is correct
130 Correct 8 ms 2388 KB Output is correct
131 Execution timed out 1599 ms 76436 KB Time limit exceeded
132 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 1 ms 212 KB Output is correct
6 Correct 1 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 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 296 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 316 KB Output is correct
15 Correct 2 ms 2608 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2636 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 2732 KB Output is correct
21 Correct 3 ms 2644 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 29 ms 6812 KB Output is correct
25 Correct 20 ms 6760 KB Output is correct
26 Correct 21 ms 6720 KB Output is correct
27 Correct 7 ms 2516 KB Output is correct
28 Correct 6 ms 2516 KB Output is correct
29 Correct 5 ms 2004 KB Output is correct
30 Correct 6 ms 1620 KB Output is correct
31 Correct 3 ms 1492 KB Output is correct
32 Correct 3 ms 1492 KB Output is correct
33 Correct 12 ms 5812 KB Output is correct
34 Correct 20 ms 5844 KB Output is correct
35 Correct 14 ms 5708 KB Output is correct
36 Correct 18 ms 5680 KB Output is correct
37 Correct 13 ms 5668 KB Output is correct
38 Correct 13 ms 5736 KB Output is correct
39 Correct 25 ms 8012 KB Output is correct
40 Correct 25 ms 7972 KB Output is correct
41 Correct 26 ms 7952 KB Output is correct
42 Correct 30 ms 10248 KB Output is correct
43 Correct 18 ms 6484 KB Output is correct
44 Correct 26 ms 8780 KB Output is correct
45 Correct 12 ms 4788 KB Output is correct
46 Correct 10 ms 4160 KB Output is correct
47 Correct 20 ms 6612 KB Output is correct
48 Correct 61 ms 18348 KB Output is correct
49 Correct 35 ms 12108 KB Output is correct
50 Correct 34 ms 13388 KB Output is correct
51 Correct 46 ms 13512 KB Output is correct
52 Correct 46 ms 13676 KB Output is correct
53 Correct 45 ms 11264 KB Output is correct
54 Correct 33 ms 11312 KB Output is correct
55 Correct 34 ms 11488 KB Output is correct
56 Correct 27 ms 9052 KB Output is correct
57 Correct 17 ms 7252 KB Output is correct
58 Correct 16 ms 6760 KB Output is correct
59 Correct 15 ms 6760 KB Output is correct
60 Correct 65 ms 20372 KB Output is correct
61 Correct 69 ms 20556 KB Output is correct
62 Correct 61 ms 20392 KB Output is correct
63 Correct 64 ms 20508 KB Output is correct
64 Correct 69 ms 20472 KB Output is correct
65 Correct 67 ms 20556 KB Output is correct
66 Correct 62 ms 17352 KB Output is correct
67 Correct 65 ms 17252 KB Output is correct
68 Correct 59 ms 17268 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 340 KB Output is correct
74 Correct 1 ms 212 KB Output is correct
75 Correct 1 ms 212 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 2 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 3 ms 2644 KB Output is correct
82 Correct 2 ms 2132 KB Output is correct
83 Correct 2 ms 2388 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 2004 KB Output is correct
86 Correct 0 ms 340 KB Output is correct
87 Correct 2 ms 2516 KB Output is correct
88 Correct 2 ms 2388 KB Output is correct
89 Correct 0 ms 340 KB Output is correct
90 Correct 1 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 3 ms 2660 KB Output is correct
96 Correct 2 ms 2644 KB Output is correct
97 Correct 3 ms 2644 KB Output is correct
98 Correct 3 ms 2644 KB Output is correct
99 Correct 2 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 380 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 4 ms 584 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 3 ms 596 KB Output is correct
110 Correct 2 ms 596 KB Output is correct
111 Correct 5 ms 572 KB Output is correct
112 Correct 3 ms 2516 KB Output is correct
113 Correct 5 ms 2132 KB Output is correct
114 Correct 3 ms 1876 KB Output is correct
115 Correct 3 ms 2004 KB Output is correct
116 Correct 5 ms 2260 KB Output is correct
117 Correct 3 ms 2772 KB Output is correct
118 Correct 19 ms 4552 KB Output is correct
119 Correct 21 ms 5400 KB Output is correct
120 Correct 25 ms 6032 KB Output is correct
121 Correct 7 ms 852 KB Output is correct
122 Correct 7 ms 784 KB Output is correct
123 Correct 7 ms 852 KB Output is correct
124 Correct 7 ms 852 KB Output is correct
125 Correct 7 ms 780 KB Output is correct
126 Correct 4 ms 2880 KB Output is correct
127 Correct 4 ms 2900 KB Output is correct
128 Correct 5 ms 2900 KB Output is correct
129 Correct 4 ms 2900 KB Output is correct
130 Correct 4 ms 2900 KB Output is correct
131 Correct 4 ms 2900 KB Output is correct
132 Correct 29 ms 6388 KB Output is correct
133 Correct 31 ms 6348 KB Output is correct
134 Correct 39 ms 6352 KB Output is correct
135 Correct 8 ms 2388 KB Output is correct
136 Correct 1239 ms 59796 KB Output is correct
137 Correct 602 ms 25708 KB Output is correct
138 Correct 454 ms 23980 KB Output is correct
139 Correct 486 ms 31892 KB Output is correct
140 Correct 286 ms 15932 KB Output is correct
141 Correct 15 ms 5016 KB Output is correct
142 Correct 15 ms 4636 KB Output is correct
143 Correct 26 ms 5552 KB Output is correct
144 Correct 17 ms 4248 KB Output is correct
145 Correct 19 ms 5100 KB Output is correct
146 Correct 15 ms 4948 KB Output is correct
147 Correct 24 ms 4692 KB Output is correct
148 Correct 7 ms 2140 KB Output is correct
149 Correct 22 ms 4816 KB Output is correct
150 Correct 7 ms 2132 KB Output is correct
151 Correct 26 ms 6128 KB Output is correct
152 Correct 11 ms 3196 KB Output is correct
153 Correct 9 ms 3324 KB Output is correct
154 Correct 10 ms 4168 KB Output is correct
155 Correct 8 ms 3520 KB Output is correct
156 Correct 7 ms 3028 KB Output is correct
157 Correct 8 ms 2388 KB Output is correct
158 Execution timed out 1599 ms 76436 KB Time limit exceeded
159 Halted 0 ms 0 KB -