Submission #810849

# Submission time Handle Problem Language Result Execution time Memory
810849 2023-08-06T16:41:36 Z _martynas Maze (JOI23_ho_t3) C++11
51 / 100
2000 ms 307072 KB
#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(a) (a).begin(), (a).end()

using pii = pair<int, int>;

const int inf = 1e7;

int r, c, n;
int sr, sc, gr, gc;
vector<string> A;

int main() {
    cin >> r >> c >> n;
    if(c > r) {
        swap(r, c);
        cin >> sc >> sr >> gc >> gr;
        A = vector<string>(r, string(c, '#'));
        for(int i = 0; i < c; i++) {
            string s; cin >> s;
            for(int j = 0; j < r; j++) {
                A[j][i] = s[j];
            }
        }
    }
    else {
        cin >> sr >> sc >> gr >> gc;
        A = vector<string>(r);
        for(int i = 0; i < c; i++) {
            cin >> A[i]; 
        }
    }
    sr--, sc--, gr--, gc--;

    // cerr << "\n";
    // for(int i = 0; i < r; i++) {
    //     cerr << A[i] << "\n";
    // }

    // c < 2500
    vector<vector<int>> dist(r, vector<int>(c, inf));
    vector<vector<bool>> visited(r, vector<bool>(c));
    vector<set<int>> checked(c);
    deque<pii> deq;
    vector<pii> dir{{-1, 0}, {1, 0}, {0, -1}, {0, 1}};

    auto transition = [&](int row, int s, int e, int d) {
        //cerr << "transit: " << row << " " << s << " " << e << " " << d << "\n";
        for(int i = s; i <= e; i++) {
            // if(dist[row][i] <= d+1) break;
            if(dist[row][i] > d+1) {
                dist[row][i] = d+1;
                deq.push_back({row, i});
            }
        }
        for(int i = e; i >= s; i--) {
            //if(dist[row][i] <= d+1) break;
            if(dist[row][i] > d+1) {
                dist[row][i] = d+1;
                deq.push_back({row, i});
            }
        }
    };

    dist[sr][sc] = 0;
    deq.push_back({sr, sc});
    while(!deq.empty()) {
        int i = deq.front().fi, j = deq.front().se;
        deq.pop_front();
        if(visited[i][j]) continue;
        visited[i][j] = true;
        for(auto d : dir) {
            int ii = i+d.fi, jj = j+d.se;
            if(ii < 0 || ii >= r || jj < 0 || jj >= c) continue;
            if(A[ii][jj] == '.' && dist[ii][jj] > dist[i][j]) {
                dist[ii][jj] = dist[i][j];
                deq.push_front({ii, jj});
            }
        }
        int li = max(0, i-(n-1)), ri = min(r-1, i+(n-1));
        if(!checked[j].empty()) {
            auto it = checked[j].lower_bound(i);
            if(it == checked[j].end()) {
                it = prev(it);
                li = max(li, (*it)+n);
            }
            else {
                ri = min(ri, (*it)-n);
                if(it != checked[j].begin()) {
                    it = prev(it);
                    li = max(li, (*it)+n);   
                }
            }
        }
        checked[j].insert(i);
        if(li <= ri) {
            for(int row = li; row <= ri; row++) {
                transition(row, max(0, j-n), min(c-1, j+n), dist[i][j]);
            }
        }
        if(i-n >= 0) {
            transition(i-n, max(0, j-n+1), min(c-1, j+n-1), dist[i][j]);
        }
        if(i+n < r) {
            transition(i+n, max(0, j-n+1), min(c-1, j+n-1), dist[i][j]);
        }
    }
    cout << dist[gr][gc] << "\n";
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 468 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 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 0 ms 212 KB Output is correct
16 Correct 1 ms 292 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 12 ms 3468 KB Output is correct
20 Correct 16 ms 9704 KB Output is correct
21 Correct 10 ms 3500 KB Output is correct
22 Correct 15 ms 3496 KB Output is correct
23 Correct 11 ms 3396 KB Output is correct
24 Correct 22 ms 12476 KB Output is correct
25 Correct 21 ms 12540 KB Output is correct
26 Correct 16 ms 3420 KB Output is correct
27 Correct 16 ms 3480 KB Output is correct
28 Correct 12 ms 3412 KB Output is correct
29 Correct 35 ms 8324 KB Output is correct
30 Correct 17 ms 8044 KB Output is correct
31 Correct 24 ms 8276 KB Output is correct
32 Correct 37 ms 8320 KB Output is correct
33 Correct 33 ms 8284 KB Output is correct
34 Correct 52 ms 30884 KB Output is correct
35 Correct 59 ms 30944 KB Output is correct
36 Correct 39 ms 8300 KB Output is correct
37 Correct 42 ms 8336 KB Output is correct
38 Correct 39 ms 8308 KB Output is correct
39 Correct 523 ms 79948 KB Output is correct
40 Correct 46 ms 10940 KB Output is correct
41 Correct 76 ms 37968 KB Output is correct
42 Correct 57 ms 11780 KB Output is correct
43 Correct 72 ms 30816 KB Output is correct
44 Correct 255 ms 55268 KB Output is correct
45 Correct 303 ms 63744 KB Output is correct
46 Correct 379 ms 80032 KB Output is correct
47 Correct 483 ms 79948 KB Output is correct
48 Correct 615 ms 79904 KB Output is correct
49 Correct 684 ms 307036 KB Output is correct
50 Correct 772 ms 307072 KB Output is correct
51 Correct 494 ms 79948 KB Output is correct
52 Correct 506 ms 79912 KB Output is correct
53 Correct 496 ms 79892 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 296 KB Output is correct
8 Correct 0 ms 300 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 424 KB Output is correct
18 Correct 0 ms 296 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 300 KB Output is correct
23 Correct 0 ms 296 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 0 ms 212 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 0 ms 296 KB Output is correct
4 Correct 0 ms 296 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 300 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 1 ms 468 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 300 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 10 ms 2372 KB Output is correct
26 Correct 15 ms 3260 KB Output is correct
27 Correct 10 ms 3412 KB Output is correct
28 Correct 28 ms 3880 KB Output is correct
29 Correct 27 ms 3540 KB Output is correct
30 Correct 26 ms 3512 KB Output is correct
31 Correct 23 ms 3540 KB Output is correct
32 Correct 16 ms 3512 KB Output is correct
33 Correct 16 ms 3456 KB Output is correct
34 Correct 72 ms 6672 KB Output is correct
35 Correct 25 ms 8252 KB Output is correct
36 Correct 92 ms 9460 KB Output is correct
37 Correct 93 ms 8288 KB Output is correct
38 Correct 90 ms 8296 KB Output is correct
39 Correct 195 ms 23504 KB Output is correct
40 Correct 911 ms 69304 KB Output is correct
41 Correct 396 ms 80028 KB Output is correct
42 Execution timed out 2086 ms 21928 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 296 KB Output is correct
8 Correct 0 ms 300 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 424 KB Output is correct
18 Correct 0 ms 296 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 300 KB Output is correct
23 Correct 0 ms 296 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 0 ms 212 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 16 ms 3512 KB Output is correct
34 Correct 1 ms 432 KB Output is correct
35 Correct 1 ms 816 KB Output is correct
36 Correct 10 ms 2296 KB Output is correct
37 Correct 16 ms 9656 KB Output is correct
38 Correct 16 ms 3280 KB Output is correct
39 Correct 10 ms 3412 KB Output is correct
40 Correct 16 ms 3544 KB Output is correct
41 Correct 11 ms 3508 KB Output is correct
42 Correct 27 ms 3892 KB Output is correct
43 Correct 27 ms 3540 KB Output is correct
44 Correct 26 ms 3504 KB Output is correct
45 Correct 22 ms 12572 KB Output is correct
46 Correct 23 ms 12488 KB Output is correct
47 Correct 16 ms 7852 KB Output is correct
48 Correct 17 ms 3992 KB Output is correct
49 Correct 18 ms 3796 KB Output is correct
50 Correct 22 ms 3584 KB Output is correct
51 Correct 23 ms 3540 KB Output is correct
52 Correct 16 ms 3412 KB Output is correct
53 Correct 16 ms 3500 KB Output is correct
54 Correct 15 ms 3668 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 296 KB Output is correct
8 Correct 0 ms 300 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 424 KB Output is correct
18 Correct 0 ms 296 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 300 KB Output is correct
23 Correct 0 ms 296 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 0 ms 212 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 16 ms 3512 KB Output is correct
34 Correct 1 ms 432 KB Output is correct
35 Correct 1 ms 816 KB Output is correct
36 Correct 10 ms 2296 KB Output is correct
37 Correct 16 ms 9656 KB Output is correct
38 Correct 16 ms 3280 KB Output is correct
39 Correct 10 ms 3412 KB Output is correct
40 Correct 16 ms 3544 KB Output is correct
41 Correct 11 ms 3508 KB Output is correct
42 Correct 27 ms 3892 KB Output is correct
43 Correct 27 ms 3540 KB Output is correct
44 Correct 26 ms 3504 KB Output is correct
45 Correct 22 ms 12572 KB Output is correct
46 Correct 23 ms 12488 KB Output is correct
47 Correct 16 ms 7852 KB Output is correct
48 Correct 17 ms 3992 KB Output is correct
49 Correct 18 ms 3796 KB Output is correct
50 Correct 22 ms 3584 KB Output is correct
51 Correct 23 ms 3540 KB Output is correct
52 Correct 16 ms 3412 KB Output is correct
53 Correct 16 ms 3500 KB Output is correct
54 Correct 15 ms 3668 KB Output is correct
55 Correct 34 ms 8256 KB Output is correct
56 Correct 18 ms 8020 KB Output is correct
57 Correct 72 ms 6776 KB Output is correct
58 Correct 38 ms 8716 KB Output is correct
59 Correct 25 ms 8292 KB Output is correct
60 Correct 37 ms 8200 KB Output is correct
61 Correct 34 ms 8280 KB Output is correct
62 Correct 95 ms 9448 KB Output is correct
63 Correct 94 ms 8288 KB Output is correct
64 Correct 91 ms 8284 KB Output is correct
65 Correct 54 ms 30876 KB Output is correct
66 Correct 60 ms 30872 KB Output is correct
67 Correct 44 ms 19196 KB Output is correct
68 Correct 48 ms 9248 KB Output is correct
69 Correct 64 ms 8812 KB Output is correct
70 Correct 61 ms 8524 KB Output is correct
71 Correct 74 ms 8488 KB Output is correct
72 Correct 39 ms 8284 KB Output is correct
73 Correct 40 ms 8240 KB Output is correct
74 Correct 32 ms 8244 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 468 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 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 0 ms 212 KB Output is correct
16 Correct 1 ms 292 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 12 ms 3468 KB Output is correct
20 Correct 16 ms 9704 KB Output is correct
21 Correct 10 ms 3500 KB Output is correct
22 Correct 15 ms 3496 KB Output is correct
23 Correct 11 ms 3396 KB Output is correct
24 Correct 22 ms 12476 KB Output is correct
25 Correct 21 ms 12540 KB Output is correct
26 Correct 16 ms 3420 KB Output is correct
27 Correct 16 ms 3480 KB Output is correct
28 Correct 12 ms 3412 KB Output is correct
29 Correct 35 ms 8324 KB Output is correct
30 Correct 17 ms 8044 KB Output is correct
31 Correct 24 ms 8276 KB Output is correct
32 Correct 37 ms 8320 KB Output is correct
33 Correct 33 ms 8284 KB Output is correct
34 Correct 52 ms 30884 KB Output is correct
35 Correct 59 ms 30944 KB Output is correct
36 Correct 39 ms 8300 KB Output is correct
37 Correct 42 ms 8336 KB Output is correct
38 Correct 39 ms 8308 KB Output is correct
39 Correct 523 ms 79948 KB Output is correct
40 Correct 46 ms 10940 KB Output is correct
41 Correct 76 ms 37968 KB Output is correct
42 Correct 57 ms 11780 KB Output is correct
43 Correct 72 ms 30816 KB Output is correct
44 Correct 255 ms 55268 KB Output is correct
45 Correct 303 ms 63744 KB Output is correct
46 Correct 379 ms 80032 KB Output is correct
47 Correct 483 ms 79948 KB Output is correct
48 Correct 615 ms 79904 KB Output is correct
49 Correct 684 ms 307036 KB Output is correct
50 Correct 772 ms 307072 KB Output is correct
51 Correct 494 ms 79948 KB Output is correct
52 Correct 506 ms 79912 KB Output is correct
53 Correct 496 ms 79892 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 0 ms 300 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 1 ms 296 KB Output is correct
61 Correct 0 ms 300 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 300 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 296 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 468 KB Output is correct
70 Correct 1 ms 424 KB Output is correct
71 Correct 0 ms 296 KB Output is correct
72 Correct 1 ms 340 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 300 KB Output is correct
76 Correct 0 ms 296 KB Output is correct
77 Correct 0 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 0 ms 212 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 0 ms 212 KB Output is correct
87 Correct 1 ms 300 KB Output is correct
88 Correct 0 ms 296 KB Output is correct
89 Correct 0 ms 296 KB Output is correct
90 Correct 0 ms 212 KB Output is correct
91 Correct 0 ms 212 KB Output is correct
92 Correct 1 ms 300 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 300 KB Output is correct
96 Correct 1 ms 300 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 0 ms 212 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 0 ms 212 KB Output is correct
103 Correct 0 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 0 ms 300 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 10 ms 2372 KB Output is correct
111 Correct 15 ms 3260 KB Output is correct
112 Correct 10 ms 3412 KB Output is correct
113 Correct 28 ms 3880 KB Output is correct
114 Correct 27 ms 3540 KB Output is correct
115 Correct 26 ms 3512 KB Output is correct
116 Correct 23 ms 3540 KB Output is correct
117 Correct 16 ms 3512 KB Output is correct
118 Correct 16 ms 3456 KB Output is correct
119 Correct 72 ms 6672 KB Output is correct
120 Correct 25 ms 8252 KB Output is correct
121 Correct 92 ms 9460 KB Output is correct
122 Correct 93 ms 8288 KB Output is correct
123 Correct 90 ms 8296 KB Output is correct
124 Correct 195 ms 23504 KB Output is correct
125 Correct 911 ms 69304 KB Output is correct
126 Correct 396 ms 80028 KB Output is correct
127 Execution timed out 2086 ms 21928 KB Time limit exceeded
128 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 468 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 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 0 ms 212 KB Output is correct
16 Correct 1 ms 292 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 12 ms 3468 KB Output is correct
20 Correct 16 ms 9704 KB Output is correct
21 Correct 10 ms 3500 KB Output is correct
22 Correct 15 ms 3496 KB Output is correct
23 Correct 11 ms 3396 KB Output is correct
24 Correct 22 ms 12476 KB Output is correct
25 Correct 21 ms 12540 KB Output is correct
26 Correct 16 ms 3420 KB Output is correct
27 Correct 16 ms 3480 KB Output is correct
28 Correct 12 ms 3412 KB Output is correct
29 Correct 35 ms 8324 KB Output is correct
30 Correct 17 ms 8044 KB Output is correct
31 Correct 24 ms 8276 KB Output is correct
32 Correct 37 ms 8320 KB Output is correct
33 Correct 33 ms 8284 KB Output is correct
34 Correct 52 ms 30884 KB Output is correct
35 Correct 59 ms 30944 KB Output is correct
36 Correct 39 ms 8300 KB Output is correct
37 Correct 42 ms 8336 KB Output is correct
38 Correct 39 ms 8308 KB Output is correct
39 Correct 523 ms 79948 KB Output is correct
40 Correct 46 ms 10940 KB Output is correct
41 Correct 76 ms 37968 KB Output is correct
42 Correct 57 ms 11780 KB Output is correct
43 Correct 72 ms 30816 KB Output is correct
44 Correct 255 ms 55268 KB Output is correct
45 Correct 303 ms 63744 KB Output is correct
46 Correct 379 ms 80032 KB Output is correct
47 Correct 483 ms 79948 KB Output is correct
48 Correct 615 ms 79904 KB Output is correct
49 Correct 684 ms 307036 KB Output is correct
50 Correct 772 ms 307072 KB Output is correct
51 Correct 494 ms 79948 KB Output is correct
52 Correct 506 ms 79912 KB Output is correct
53 Correct 496 ms 79892 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 0 ms 300 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 1 ms 296 KB Output is correct
61 Correct 0 ms 300 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 300 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 296 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 468 KB Output is correct
70 Correct 1 ms 424 KB Output is correct
71 Correct 0 ms 296 KB Output is correct
72 Correct 1 ms 340 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 300 KB Output is correct
76 Correct 0 ms 296 KB Output is correct
77 Correct 0 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 0 ms 212 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 0 ms 212 KB Output is correct
87 Correct 1 ms 300 KB Output is correct
88 Correct 0 ms 296 KB Output is correct
89 Correct 0 ms 296 KB Output is correct
90 Correct 0 ms 212 KB Output is correct
91 Correct 0 ms 212 KB Output is correct
92 Correct 1 ms 300 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 300 KB Output is correct
96 Correct 1 ms 300 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 0 ms 212 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 0 ms 212 KB Output is correct
103 Correct 0 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 0 ms 300 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 10 ms 2372 KB Output is correct
111 Correct 15 ms 3260 KB Output is correct
112 Correct 10 ms 3412 KB Output is correct
113 Correct 28 ms 3880 KB Output is correct
114 Correct 27 ms 3540 KB Output is correct
115 Correct 26 ms 3512 KB Output is correct
116 Correct 23 ms 3540 KB Output is correct
117 Correct 16 ms 3512 KB Output is correct
118 Correct 16 ms 3456 KB Output is correct
119 Correct 72 ms 6672 KB Output is correct
120 Correct 25 ms 8252 KB Output is correct
121 Correct 92 ms 9460 KB Output is correct
122 Correct 93 ms 8288 KB Output is correct
123 Correct 90 ms 8296 KB Output is correct
124 Correct 195 ms 23504 KB Output is correct
125 Correct 911 ms 69304 KB Output is correct
126 Correct 396 ms 80028 KB Output is correct
127 Execution timed out 2086 ms 21928 KB Time limit exceeded
128 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 468 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 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 0 ms 212 KB Output is correct
16 Correct 1 ms 292 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 12 ms 3468 KB Output is correct
20 Correct 16 ms 9704 KB Output is correct
21 Correct 10 ms 3500 KB Output is correct
22 Correct 15 ms 3496 KB Output is correct
23 Correct 11 ms 3396 KB Output is correct
24 Correct 22 ms 12476 KB Output is correct
25 Correct 21 ms 12540 KB Output is correct
26 Correct 16 ms 3420 KB Output is correct
27 Correct 16 ms 3480 KB Output is correct
28 Correct 12 ms 3412 KB Output is correct
29 Correct 35 ms 8324 KB Output is correct
30 Correct 17 ms 8044 KB Output is correct
31 Correct 24 ms 8276 KB Output is correct
32 Correct 37 ms 8320 KB Output is correct
33 Correct 33 ms 8284 KB Output is correct
34 Correct 52 ms 30884 KB Output is correct
35 Correct 59 ms 30944 KB Output is correct
36 Correct 39 ms 8300 KB Output is correct
37 Correct 42 ms 8336 KB Output is correct
38 Correct 39 ms 8308 KB Output is correct
39 Correct 523 ms 79948 KB Output is correct
40 Correct 46 ms 10940 KB Output is correct
41 Correct 76 ms 37968 KB Output is correct
42 Correct 57 ms 11780 KB Output is correct
43 Correct 72 ms 30816 KB Output is correct
44 Correct 255 ms 55268 KB Output is correct
45 Correct 303 ms 63744 KB Output is correct
46 Correct 379 ms 80032 KB Output is correct
47 Correct 483 ms 79948 KB Output is correct
48 Correct 615 ms 79904 KB Output is correct
49 Correct 684 ms 307036 KB Output is correct
50 Correct 772 ms 307072 KB Output is correct
51 Correct 494 ms 79948 KB Output is correct
52 Correct 506 ms 79912 KB Output is correct
53 Correct 496 ms 79892 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 0 ms 300 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 1 ms 296 KB Output is correct
61 Correct 0 ms 300 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 300 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 296 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 468 KB Output is correct
70 Correct 1 ms 424 KB Output is correct
71 Correct 0 ms 296 KB Output is correct
72 Correct 1 ms 340 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 300 KB Output is correct
76 Correct 0 ms 296 KB Output is correct
77 Correct 0 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 0 ms 212 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 0 ms 212 KB Output is correct
87 Correct 1 ms 300 KB Output is correct
88 Correct 0 ms 296 KB Output is correct
89 Correct 0 ms 296 KB Output is correct
90 Correct 0 ms 212 KB Output is correct
91 Correct 0 ms 212 KB Output is correct
92 Correct 1 ms 300 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 300 KB Output is correct
96 Correct 1 ms 300 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 0 ms 212 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 0 ms 212 KB Output is correct
103 Correct 0 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 0 ms 300 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 10 ms 2372 KB Output is correct
111 Correct 15 ms 3260 KB Output is correct
112 Correct 10 ms 3412 KB Output is correct
113 Correct 28 ms 3880 KB Output is correct
114 Correct 27 ms 3540 KB Output is correct
115 Correct 26 ms 3512 KB Output is correct
116 Correct 23 ms 3540 KB Output is correct
117 Correct 16 ms 3512 KB Output is correct
118 Correct 16 ms 3456 KB Output is correct
119 Correct 72 ms 6672 KB Output is correct
120 Correct 25 ms 8252 KB Output is correct
121 Correct 92 ms 9460 KB Output is correct
122 Correct 93 ms 8288 KB Output is correct
123 Correct 90 ms 8296 KB Output is correct
124 Correct 195 ms 23504 KB Output is correct
125 Correct 911 ms 69304 KB Output is correct
126 Correct 396 ms 80028 KB Output is correct
127 Execution timed out 2086 ms 21928 KB Time limit exceeded
128 Halted 0 ms 0 KB -