Submission #742696

# Submission time Handle Problem Language Result Execution time Memory
742696 2023-05-16T18:27:25 Z brunnorezendes Maze (JOI23_ho_t3) C++14
43 / 100
1044 ms 62944 KB
#include <bits/stdc++.h>
#define f first
#define s second
#define inf 10000000

using namespace std;

typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<ii,ii> iii;
typedef pair<ii,iii> iiii;
priority_queue <iiii> q; // distancia, distancia pro ponto base da carimbada, x e y do ponto base da carimbada, i, j

int difx[4] = {0, 1, 0, -1};
int dify[4] = {1, 0, -1, 0};
int r, c, n;
vvi dist;
vvi m;

void bfs(ii ini){
    int i, a, b;
    q.push({{0, 0}, {{-1, -1}, {ini.f, ini.s}}});
    iiii next;
    while(!q.empty()){
        next = q.top();
        q.pop();
        if(dist[next.s.s.f][next.s.s.s]<=-next.f.f) continue;
        dist[next.s.s.f][next.s.s.s]=-next.f.f;
        for(i=0;i<4;i++){
            a = next.s.s.f+difx[i];
            b = next.s.s.s+dify[i];
            if(a<0 || a==r || b<0 || b==c) continue;
            if(dist[a][b]==inf){
                if(m[a][b]){
                    if(next.s.f.s==-1 || abs(a-next.s.f.f)==n || abs(b-next.s.f.s)==n)
                        q.push({{next.f.f, 0}, {{-1, -1}, {a, b}}});
                    else
                        q.push({{next.f.f, next.f.s-1}, {next.s.f, {a, b}}});
                }
                else{
                    if(next.s.f.s==-1 || abs(a-next.s.f.f)==n || abs(b-next.s.f.s)==n)
                        q.push({{next.f.f-1, 0}, {{a, b}, {a, b}}});
                    else
                        q.push({{next.f.f, next.f.s-1}, {next.s.f, {a, b}}});
                }
            }
        }
    }
}

int main (){
    int i, j;
    char a;
    ii fim, ini;
    cin >> r >> c >> n;
    m = vvi(r, vi(c, 0));
    dist = vvi(r, vi(c, inf));
    cin >> ini.f >> ini.s;
    ini.f--;ini.s--;
    cin >> fim.f >> fim.s;
    fim.s--;fim.f--;
    for(i=0;i<r;i++){
        for(j=0;j<c;j++){
            cin >> a;
            if(a=='.') m[i][j] = 1; // # = 0 (preto) e . = 1 (branco)
            dist[i][j] = inf;
        }
    }
    bfs(ini);
    cout << dist[fim.f][fim.s] << endl;
    return 0;
}
# Verdict Execution time Memory 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 304 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 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 1 ms 212 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 300 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 24 ms 852 KB Output is correct
20 Correct 5 ms 796 KB Output is correct
21 Correct 21 ms 980 KB Output is correct
22 Correct 28 ms 980 KB Output is correct
23 Correct 21 ms 868 KB Output is correct
24 Correct 8 ms 1000 KB Output is correct
25 Correct 7 ms 972 KB Output is correct
26 Correct 31 ms 1228 KB Output is correct
27 Correct 31 ms 1224 KB Output is correct
28 Correct 25 ms 936 KB Output is correct
29 Correct 58 ms 1604 KB Output is correct
30 Correct 15 ms 816 KB Output is correct
31 Correct 59 ms 1804 KB Output is correct
32 Correct 75 ms 1868 KB Output is correct
33 Correct 58 ms 1780 KB Output is correct
34 Correct 17 ms 2084 KB Output is correct
35 Correct 15 ms 2184 KB Output is correct
36 Correct 79 ms 2480 KB Output is correct
37 Correct 72 ms 2028 KB Output is correct
38 Correct 59 ms 1748 KB Output is correct
39 Correct 644 ms 12744 KB Output is correct
40 Correct 66 ms 1708 KB Output is correct
41 Correct 24 ms 2524 KB Output is correct
42 Correct 89 ms 2056 KB Output is correct
43 Correct 43 ms 2808 KB Output is correct
44 Correct 260 ms 6728 KB Output is correct
45 Correct 210 ms 7980 KB Output is correct
46 Correct 668 ms 15112 KB Output is correct
47 Correct 729 ms 13536 KB Output is correct
48 Correct 566 ms 13740 KB Output is correct
49 Correct 155 ms 19300 KB Output is correct
50 Correct 146 ms 19300 KB Output is correct
51 Correct 823 ms 16628 KB Output is correct
52 Correct 790 ms 14432 KB Output is correct
53 Correct 650 ms 14028 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 304 KB Output is correct
4 Correct 0 ms 296 KB Output is correct
5 Correct 1 ms 300 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 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 300 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 300 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 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 304 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 300 KB Output is correct
28 Correct 1 ms 304 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
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 296 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 300 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 300 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 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 300 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 300 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 15 ms 632 KB Output is correct
26 Correct 28 ms 2416 KB Output is correct
27 Correct 26 ms 980 KB Output is correct
28 Correct 23 ms 888 KB Output is correct
29 Correct 22 ms 852 KB Output is correct
30 Correct 19 ms 820 KB Output is correct
31 Correct 23 ms 852 KB Output is correct
32 Correct 30 ms 1304 KB Output is correct
33 Correct 28 ms 1084 KB Output is correct
34 Correct 68 ms 4548 KB Output is correct
35 Correct 62 ms 1904 KB Output is correct
36 Correct 64 ms 1864 KB Output is correct
37 Correct 51 ms 1620 KB Output is correct
38 Correct 51 ms 1620 KB Output is correct
39 Correct 245 ms 16500 KB Output is correct
40 Correct 801 ms 36172 KB Output is correct
41 Correct 633 ms 15376 KB Output is correct
42 Correct 640 ms 15076 KB Output is correct
43 Correct 590 ms 13768 KB Output is correct
44 Correct 536 ms 13724 KB Output is correct
45 Correct 1030 ms 62944 KB Output is correct
46 Correct 1044 ms 62928 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 304 KB Output is correct
4 Correct 0 ms 296 KB Output is correct
5 Correct 1 ms 300 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 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 300 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 300 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 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 304 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 300 KB Output is correct
28 Correct 1 ms 304 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 22 ms 872 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 17 ms 672 KB Output is correct
37 Correct 5 ms 868 KB Output is correct
38 Correct 30 ms 2416 KB Output is correct
39 Correct 22 ms 980 KB Output is correct
40 Correct 31 ms 996 KB Output is correct
41 Correct 19 ms 852 KB Output is correct
42 Correct 22 ms 928 KB Output is correct
43 Correct 23 ms 856 KB Output is correct
44 Correct 21 ms 800 KB Output is correct
45 Correct 7 ms 1000 KB Output is correct
46 Correct 7 ms 1000 KB Output is correct
47 Correct 11 ms 896 KB Output is correct
48 Incorrect 20 ms 836 KB Output isn't correct
49 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 304 KB Output is correct
4 Correct 0 ms 296 KB Output is correct
5 Correct 1 ms 300 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 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 300 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 300 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 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 304 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 300 KB Output is correct
28 Correct 1 ms 304 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 22 ms 872 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 17 ms 672 KB Output is correct
37 Correct 5 ms 868 KB Output is correct
38 Correct 30 ms 2416 KB Output is correct
39 Correct 22 ms 980 KB Output is correct
40 Correct 31 ms 996 KB Output is correct
41 Correct 19 ms 852 KB Output is correct
42 Correct 22 ms 928 KB Output is correct
43 Correct 23 ms 856 KB Output is correct
44 Correct 21 ms 800 KB Output is correct
45 Correct 7 ms 1000 KB Output is correct
46 Correct 7 ms 1000 KB Output is correct
47 Correct 11 ms 896 KB Output is correct
48 Incorrect 20 ms 836 KB Output isn't correct
49 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 304 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 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 1 ms 212 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 300 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 24 ms 852 KB Output is correct
20 Correct 5 ms 796 KB Output is correct
21 Correct 21 ms 980 KB Output is correct
22 Correct 28 ms 980 KB Output is correct
23 Correct 21 ms 868 KB Output is correct
24 Correct 8 ms 1000 KB Output is correct
25 Correct 7 ms 972 KB Output is correct
26 Correct 31 ms 1228 KB Output is correct
27 Correct 31 ms 1224 KB Output is correct
28 Correct 25 ms 936 KB Output is correct
29 Correct 58 ms 1604 KB Output is correct
30 Correct 15 ms 816 KB Output is correct
31 Correct 59 ms 1804 KB Output is correct
32 Correct 75 ms 1868 KB Output is correct
33 Correct 58 ms 1780 KB Output is correct
34 Correct 17 ms 2084 KB Output is correct
35 Correct 15 ms 2184 KB Output is correct
36 Correct 79 ms 2480 KB Output is correct
37 Correct 72 ms 2028 KB Output is correct
38 Correct 59 ms 1748 KB Output is correct
39 Correct 644 ms 12744 KB Output is correct
40 Correct 66 ms 1708 KB Output is correct
41 Correct 24 ms 2524 KB Output is correct
42 Correct 89 ms 2056 KB Output is correct
43 Correct 43 ms 2808 KB Output is correct
44 Correct 260 ms 6728 KB Output is correct
45 Correct 210 ms 7980 KB Output is correct
46 Correct 668 ms 15112 KB Output is correct
47 Correct 729 ms 13536 KB Output is correct
48 Correct 566 ms 13740 KB Output is correct
49 Correct 155 ms 19300 KB Output is correct
50 Correct 146 ms 19300 KB Output is correct
51 Correct 823 ms 16628 KB Output is correct
52 Correct 790 ms 14432 KB Output is correct
53 Correct 650 ms 14028 KB Output is correct
54 Correct 1 ms 296 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 304 KB Output is correct
57 Correct 0 ms 296 KB Output is correct
58 Correct 1 ms 300 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 212 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 300 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 300 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 1 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 304 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 212 KB Output is correct
79 Correct 1 ms 212 KB Output is correct
80 Correct 1 ms 300 KB Output is correct
81 Correct 1 ms 304 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 1 ms 212 KB Output is correct
86 Correct 1 ms 256 KB Output is correct
87 Correct 1 ms 212 KB Output is correct
88 Correct 1 ms 296 KB Output is correct
89 Correct 1 ms 212 KB Output is correct
90 Correct 0 ms 300 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 300 KB Output is correct
95 Correct 1 ms 212 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 212 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 300 KB Output is correct
100 Correct 1 ms 212 KB Output is correct
101 Correct 1 ms 212 KB Output is correct
102 Correct 1 ms 300 KB Output is correct
103 Correct 0 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 1 ms 300 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 1 ms 212 KB Output is correct
108 Correct 1 ms 212 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 15 ms 632 KB Output is correct
111 Correct 28 ms 2416 KB Output is correct
112 Correct 26 ms 980 KB Output is correct
113 Correct 23 ms 888 KB Output is correct
114 Correct 22 ms 852 KB Output is correct
115 Correct 19 ms 820 KB Output is correct
116 Correct 23 ms 852 KB Output is correct
117 Correct 30 ms 1304 KB Output is correct
118 Correct 28 ms 1084 KB Output is correct
119 Correct 68 ms 4548 KB Output is correct
120 Correct 62 ms 1904 KB Output is correct
121 Correct 64 ms 1864 KB Output is correct
122 Correct 51 ms 1620 KB Output is correct
123 Correct 51 ms 1620 KB Output is correct
124 Correct 245 ms 16500 KB Output is correct
125 Correct 801 ms 36172 KB Output is correct
126 Correct 633 ms 15376 KB Output is correct
127 Correct 640 ms 15076 KB Output is correct
128 Correct 590 ms 13768 KB Output is correct
129 Correct 536 ms 13724 KB Output is correct
130 Correct 1030 ms 62944 KB Output is correct
131 Correct 1044 ms 62928 KB Output is correct
132 Correct 22 ms 872 KB Output is correct
133 Correct 1 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 17 ms 672 KB Output is correct
136 Correct 5 ms 868 KB Output is correct
137 Correct 30 ms 2416 KB Output is correct
138 Correct 22 ms 980 KB Output is correct
139 Correct 31 ms 996 KB Output is correct
140 Correct 19 ms 852 KB Output is correct
141 Correct 22 ms 928 KB Output is correct
142 Correct 23 ms 856 KB Output is correct
143 Correct 21 ms 800 KB Output is correct
144 Correct 7 ms 1000 KB Output is correct
145 Correct 7 ms 1000 KB Output is correct
146 Correct 11 ms 896 KB Output is correct
147 Incorrect 20 ms 836 KB Output isn't correct
148 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 304 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 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 1 ms 212 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 300 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 24 ms 852 KB Output is correct
20 Correct 5 ms 796 KB Output is correct
21 Correct 21 ms 980 KB Output is correct
22 Correct 28 ms 980 KB Output is correct
23 Correct 21 ms 868 KB Output is correct
24 Correct 8 ms 1000 KB Output is correct
25 Correct 7 ms 972 KB Output is correct
26 Correct 31 ms 1228 KB Output is correct
27 Correct 31 ms 1224 KB Output is correct
28 Correct 25 ms 936 KB Output is correct
29 Correct 58 ms 1604 KB Output is correct
30 Correct 15 ms 816 KB Output is correct
31 Correct 59 ms 1804 KB Output is correct
32 Correct 75 ms 1868 KB Output is correct
33 Correct 58 ms 1780 KB Output is correct
34 Correct 17 ms 2084 KB Output is correct
35 Correct 15 ms 2184 KB Output is correct
36 Correct 79 ms 2480 KB Output is correct
37 Correct 72 ms 2028 KB Output is correct
38 Correct 59 ms 1748 KB Output is correct
39 Correct 644 ms 12744 KB Output is correct
40 Correct 66 ms 1708 KB Output is correct
41 Correct 24 ms 2524 KB Output is correct
42 Correct 89 ms 2056 KB Output is correct
43 Correct 43 ms 2808 KB Output is correct
44 Correct 260 ms 6728 KB Output is correct
45 Correct 210 ms 7980 KB Output is correct
46 Correct 668 ms 15112 KB Output is correct
47 Correct 729 ms 13536 KB Output is correct
48 Correct 566 ms 13740 KB Output is correct
49 Correct 155 ms 19300 KB Output is correct
50 Correct 146 ms 19300 KB Output is correct
51 Correct 823 ms 16628 KB Output is correct
52 Correct 790 ms 14432 KB Output is correct
53 Correct 650 ms 14028 KB Output is correct
54 Correct 1 ms 296 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 304 KB Output is correct
57 Correct 0 ms 296 KB Output is correct
58 Correct 1 ms 300 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 212 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 300 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 300 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 1 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 304 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 212 KB Output is correct
79 Correct 1 ms 212 KB Output is correct
80 Correct 1 ms 300 KB Output is correct
81 Correct 1 ms 304 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 1 ms 212 KB Output is correct
86 Correct 1 ms 256 KB Output is correct
87 Correct 1 ms 212 KB Output is correct
88 Correct 1 ms 296 KB Output is correct
89 Correct 1 ms 212 KB Output is correct
90 Correct 0 ms 300 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 300 KB Output is correct
95 Correct 1 ms 212 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 212 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 300 KB Output is correct
100 Correct 1 ms 212 KB Output is correct
101 Correct 1 ms 212 KB Output is correct
102 Correct 1 ms 300 KB Output is correct
103 Correct 0 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 1 ms 300 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 1 ms 212 KB Output is correct
108 Correct 1 ms 212 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 15 ms 632 KB Output is correct
111 Correct 28 ms 2416 KB Output is correct
112 Correct 26 ms 980 KB Output is correct
113 Correct 23 ms 888 KB Output is correct
114 Correct 22 ms 852 KB Output is correct
115 Correct 19 ms 820 KB Output is correct
116 Correct 23 ms 852 KB Output is correct
117 Correct 30 ms 1304 KB Output is correct
118 Correct 28 ms 1084 KB Output is correct
119 Correct 68 ms 4548 KB Output is correct
120 Correct 62 ms 1904 KB Output is correct
121 Correct 64 ms 1864 KB Output is correct
122 Correct 51 ms 1620 KB Output is correct
123 Correct 51 ms 1620 KB Output is correct
124 Correct 245 ms 16500 KB Output is correct
125 Correct 801 ms 36172 KB Output is correct
126 Correct 633 ms 15376 KB Output is correct
127 Correct 640 ms 15076 KB Output is correct
128 Correct 590 ms 13768 KB Output is correct
129 Correct 536 ms 13724 KB Output is correct
130 Correct 1030 ms 62944 KB Output is correct
131 Correct 1044 ms 62928 KB Output is correct
132 Correct 22 ms 872 KB Output is correct
133 Correct 1 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 17 ms 672 KB Output is correct
136 Correct 5 ms 868 KB Output is correct
137 Correct 30 ms 2416 KB Output is correct
138 Correct 22 ms 980 KB Output is correct
139 Correct 31 ms 996 KB Output is correct
140 Correct 19 ms 852 KB Output is correct
141 Correct 22 ms 928 KB Output is correct
142 Correct 23 ms 856 KB Output is correct
143 Correct 21 ms 800 KB Output is correct
144 Correct 7 ms 1000 KB Output is correct
145 Correct 7 ms 1000 KB Output is correct
146 Correct 11 ms 896 KB Output is correct
147 Incorrect 20 ms 836 KB Output isn't correct
148 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 304 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 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 1 ms 212 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 300 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 24 ms 852 KB Output is correct
20 Correct 5 ms 796 KB Output is correct
21 Correct 21 ms 980 KB Output is correct
22 Correct 28 ms 980 KB Output is correct
23 Correct 21 ms 868 KB Output is correct
24 Correct 8 ms 1000 KB Output is correct
25 Correct 7 ms 972 KB Output is correct
26 Correct 31 ms 1228 KB Output is correct
27 Correct 31 ms 1224 KB Output is correct
28 Correct 25 ms 936 KB Output is correct
29 Correct 58 ms 1604 KB Output is correct
30 Correct 15 ms 816 KB Output is correct
31 Correct 59 ms 1804 KB Output is correct
32 Correct 75 ms 1868 KB Output is correct
33 Correct 58 ms 1780 KB Output is correct
34 Correct 17 ms 2084 KB Output is correct
35 Correct 15 ms 2184 KB Output is correct
36 Correct 79 ms 2480 KB Output is correct
37 Correct 72 ms 2028 KB Output is correct
38 Correct 59 ms 1748 KB Output is correct
39 Correct 644 ms 12744 KB Output is correct
40 Correct 66 ms 1708 KB Output is correct
41 Correct 24 ms 2524 KB Output is correct
42 Correct 89 ms 2056 KB Output is correct
43 Correct 43 ms 2808 KB Output is correct
44 Correct 260 ms 6728 KB Output is correct
45 Correct 210 ms 7980 KB Output is correct
46 Correct 668 ms 15112 KB Output is correct
47 Correct 729 ms 13536 KB Output is correct
48 Correct 566 ms 13740 KB Output is correct
49 Correct 155 ms 19300 KB Output is correct
50 Correct 146 ms 19300 KB Output is correct
51 Correct 823 ms 16628 KB Output is correct
52 Correct 790 ms 14432 KB Output is correct
53 Correct 650 ms 14028 KB Output is correct
54 Correct 1 ms 296 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 304 KB Output is correct
57 Correct 0 ms 296 KB Output is correct
58 Correct 1 ms 300 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 212 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 300 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 300 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 1 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 304 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 212 KB Output is correct
79 Correct 1 ms 212 KB Output is correct
80 Correct 1 ms 300 KB Output is correct
81 Correct 1 ms 304 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 1 ms 212 KB Output is correct
86 Correct 1 ms 256 KB Output is correct
87 Correct 1 ms 212 KB Output is correct
88 Correct 1 ms 296 KB Output is correct
89 Correct 1 ms 212 KB Output is correct
90 Correct 0 ms 300 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 300 KB Output is correct
95 Correct 1 ms 212 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 212 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 300 KB Output is correct
100 Correct 1 ms 212 KB Output is correct
101 Correct 1 ms 212 KB Output is correct
102 Correct 1 ms 300 KB Output is correct
103 Correct 0 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 1 ms 300 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 1 ms 212 KB Output is correct
108 Correct 1 ms 212 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 15 ms 632 KB Output is correct
111 Correct 28 ms 2416 KB Output is correct
112 Correct 26 ms 980 KB Output is correct
113 Correct 23 ms 888 KB Output is correct
114 Correct 22 ms 852 KB Output is correct
115 Correct 19 ms 820 KB Output is correct
116 Correct 23 ms 852 KB Output is correct
117 Correct 30 ms 1304 KB Output is correct
118 Correct 28 ms 1084 KB Output is correct
119 Correct 68 ms 4548 KB Output is correct
120 Correct 62 ms 1904 KB Output is correct
121 Correct 64 ms 1864 KB Output is correct
122 Correct 51 ms 1620 KB Output is correct
123 Correct 51 ms 1620 KB Output is correct
124 Correct 245 ms 16500 KB Output is correct
125 Correct 801 ms 36172 KB Output is correct
126 Correct 633 ms 15376 KB Output is correct
127 Correct 640 ms 15076 KB Output is correct
128 Correct 590 ms 13768 KB Output is correct
129 Correct 536 ms 13724 KB Output is correct
130 Correct 1030 ms 62944 KB Output is correct
131 Correct 1044 ms 62928 KB Output is correct
132 Correct 22 ms 872 KB Output is correct
133 Correct 1 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 17 ms 672 KB Output is correct
136 Correct 5 ms 868 KB Output is correct
137 Correct 30 ms 2416 KB Output is correct
138 Correct 22 ms 980 KB Output is correct
139 Correct 31 ms 996 KB Output is correct
140 Correct 19 ms 852 KB Output is correct
141 Correct 22 ms 928 KB Output is correct
142 Correct 23 ms 856 KB Output is correct
143 Correct 21 ms 800 KB Output is correct
144 Correct 7 ms 1000 KB Output is correct
145 Correct 7 ms 1000 KB Output is correct
146 Correct 11 ms 896 KB Output is correct
147 Incorrect 20 ms 836 KB Output isn't correct
148 Halted 0 ms 0 KB -