Submission #988314

# Submission time Handle Problem Language Result Execution time Memory
988314 2024-05-24T13:25:03 Z Otalp Maze (JOI23_ho_t3) C++14
100 / 100
1357 ms 346776 KB
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second


vector<vector<int> > a;
vector<vector<int> > dp, us;
vector<vector<int> > e;

void solve(){
    int h, w, n;
    cin>>h>>w>>n;
    for(int i=0; i<=h + 1; i++){
        dp.pb({});
        a.pb({});
        us.pb({});
        e.pb({});
        for(int j=0; j<=w + 1; j++){
            dp[i].pb(0);
            a[i].pb(0);
            us[i].pb(0);
            e[i].pb(0);
        }
    }
    pii s, f;
    cin>>s.ff>>s.ss;
    cin>>f.ff>>f.ss;
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            char c;
            cin>>c;
            if(c == '#') a[i][j] = 1;
            else a[i][j] = 0;
        }
    }

    deque<pair<pii, int >> q, dq;
    dq.pb({s, n - 1});
    vector<pii> nap1={{0, 1}, {1, 0}, {0, -1}, {-1, 0}}, nap2 = {{1, -1}, {-1, 1}, {1, 1}, {-1, -1}};
    int ls = 0;
    while(dq.size()){
        q = dq;
        dq.clear();
        while(q.size()){
            int x = q[0].ff.ff, y = q[0].ff.ss;
            if(us[x][y]){
                q.pop_front();
                continue;
            }
            dp[x][y] = ls;
            us[x][y] = 1;
            e[x][y] = q[0].ss;
            //cout<<x<<' '<<y<<' '<<ls<<' '<<e[x][y]<<'\n';
            q.pop_front();
            for(pii H: nap1){
                int l=x + H.ff, r = y +H.ss;
                if(l <= 0 or l > h or r <= 0 or r > w) continue;
                if(e[x][y] == n - 1){
                    if(a[l][r] == 1){
                        dq.pb({{l, r}, 0});
                    }
                    else{
                        q.pb({{l, r}, e[x][y]});
                    }
                } 
                else{
                    q.pb({{l, r}, e[x][y] + 1});
                }
            }
            if(e[x][y] < n - 1){
                for(pii H: nap2){
                    int l=x + H.ff, r = y +H.ss;
                    if(l <= 0 or l > h or r <= 0 or r > w) continue;
                    q.pb({{l, r}, e[x][y] + 1});
                }
            }
        }
        ls ++;
    }
    cout<<dp[f.ff][f.ss];
}



int main(){
    solve();
}
























# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 432 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 8 ms 1372 KB Output is correct
20 Correct 6 ms 3216 KB Output is correct
21 Correct 7 ms 1372 KB Output is correct
22 Correct 10 ms 1628 KB Output is correct
23 Correct 7 ms 1372 KB Output is correct
24 Correct 8 ms 3732 KB Output is correct
25 Correct 8 ms 3732 KB Output is correct
26 Correct 9 ms 1880 KB Output is correct
27 Correct 9 ms 1628 KB Output is correct
28 Correct 7 ms 1628 KB Output is correct
29 Correct 20 ms 3796 KB Output is correct
30 Correct 9 ms 2820 KB Output is correct
31 Correct 16 ms 3928 KB Output is correct
32 Correct 22 ms 3940 KB Output is correct
33 Correct 18 ms 3676 KB Output is correct
34 Correct 18 ms 9792 KB Output is correct
35 Correct 21 ms 9804 KB Output is correct
36 Correct 24 ms 4444 KB Output is correct
37 Correct 22 ms 4188 KB Output is correct
38 Correct 19 ms 3928 KB Output is correct
39 Correct 254 ms 41876 KB Output is correct
40 Correct 24 ms 4444 KB Output is correct
41 Correct 22 ms 11188 KB Output is correct
42 Correct 36 ms 6620 KB Output is correct
43 Correct 32 ms 9028 KB Output is correct
44 Correct 100 ms 17376 KB Output is correct
45 Correct 118 ms 20912 KB Output is correct
46 Correct 270 ms 42900 KB Output is correct
47 Correct 304 ms 42156 KB Output is correct
48 Correct 267 ms 41572 KB Output is correct
49 Correct 160 ms 89392 KB Output is correct
50 Correct 187 ms 88540 KB Output is correct
51 Correct 290 ms 44384 KB Output is correct
52 Correct 319 ms 42656 KB Output is correct
53 Correct 243 ms 41952 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 436 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 600 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 432 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 344 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 612 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 604 KB Output is correct
9 Correct 1 ms 352 KB Output is correct
10 Correct 1 ms 356 KB Output is correct
11 Correct 1 ms 352 KB Output is correct
12 Correct 1 ms 356 KB Output is correct
13 Correct 1 ms 356 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 600 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 600 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 9 ms 1628 KB Output is correct
26 Correct 10 ms 2904 KB Output is correct
27 Correct 7 ms 1372 KB Output is correct
28 Correct 8 ms 1372 KB Output is correct
29 Correct 10 ms 1372 KB Output is correct
30 Correct 9 ms 1372 KB Output is correct
31 Correct 10 ms 1372 KB Output is correct
32 Correct 9 ms 1880 KB Output is correct
33 Correct 9 ms 1628 KB Output is correct
34 Correct 23 ms 6636 KB Output is correct
35 Correct 17 ms 3676 KB Output is correct
36 Correct 19 ms 3928 KB Output is correct
37 Correct 26 ms 3796 KB Output is correct
38 Correct 22 ms 3676 KB Output is correct
39 Correct 84 ms 22336 KB Output is correct
40 Correct 260 ms 57352 KB Output is correct
41 Correct 255 ms 42856 KB Output is correct
42 Correct 239 ms 42956 KB Output is correct
43 Correct 261 ms 41656 KB Output is correct
44 Correct 258 ms 41748 KB Output is correct
45 Correct 290 ms 74288 KB Output is correct
46 Correct 341 ms 76808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 436 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 600 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 432 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 344 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 8 ms 1368 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 604 KB Output is correct
36 Correct 6 ms 1372 KB Output is correct
37 Correct 6 ms 3220 KB Output is correct
38 Correct 11 ms 2808 KB Output is correct
39 Correct 7 ms 1368 KB Output is correct
40 Correct 9 ms 1880 KB Output is correct
41 Correct 9 ms 1368 KB Output is correct
42 Correct 9 ms 1560 KB Output is correct
43 Correct 10 ms 1368 KB Output is correct
44 Correct 9 ms 1472 KB Output is correct
45 Correct 7 ms 3732 KB Output is correct
46 Correct 8 ms 3732 KB Output is correct
47 Correct 9 ms 2620 KB Output is correct
48 Correct 9 ms 1624 KB Output is correct
49 Correct 10 ms 1884 KB Output is correct
50 Correct 10 ms 1628 KB Output is correct
51 Correct 12 ms 1560 KB Output is correct
52 Correct 9 ms 1984 KB Output is correct
53 Correct 9 ms 1628 KB Output is correct
54 Correct 7 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 436 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 600 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 432 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 344 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 8 ms 1368 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 604 KB Output is correct
36 Correct 6 ms 1372 KB Output is correct
37 Correct 6 ms 3220 KB Output is correct
38 Correct 11 ms 2808 KB Output is correct
39 Correct 7 ms 1368 KB Output is correct
40 Correct 9 ms 1880 KB Output is correct
41 Correct 9 ms 1368 KB Output is correct
42 Correct 9 ms 1560 KB Output is correct
43 Correct 10 ms 1368 KB Output is correct
44 Correct 9 ms 1472 KB Output is correct
45 Correct 7 ms 3732 KB Output is correct
46 Correct 8 ms 3732 KB Output is correct
47 Correct 9 ms 2620 KB Output is correct
48 Correct 9 ms 1624 KB Output is correct
49 Correct 10 ms 1884 KB Output is correct
50 Correct 10 ms 1628 KB Output is correct
51 Correct 12 ms 1560 KB Output is correct
52 Correct 9 ms 1984 KB Output is correct
53 Correct 9 ms 1628 KB Output is correct
54 Correct 7 ms 1372 KB Output is correct
55 Correct 18 ms 3676 KB Output is correct
56 Correct 9 ms 2620 KB Output is correct
57 Correct 18 ms 6492 KB Output is correct
58 Correct 20 ms 3672 KB Output is correct
59 Correct 16 ms 3676 KB Output is correct
60 Correct 26 ms 4184 KB Output is correct
61 Correct 21 ms 3672 KB Output is correct
62 Correct 16 ms 3668 KB Output is correct
63 Correct 23 ms 3672 KB Output is correct
64 Correct 26 ms 3672 KB Output is correct
65 Correct 18 ms 9652 KB Output is correct
66 Correct 21 ms 9652 KB Output is correct
67 Correct 21 ms 6212 KB Output is correct
68 Correct 23 ms 3420 KB Output is correct
69 Correct 24 ms 3932 KB Output is correct
70 Correct 24 ms 3928 KB Output is correct
71 Correct 23 ms 3164 KB Output is correct
72 Correct 29 ms 4444 KB Output is correct
73 Correct 23 ms 4188 KB Output is correct
74 Correct 18 ms 3932 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 432 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 8 ms 1372 KB Output is correct
20 Correct 6 ms 3216 KB Output is correct
21 Correct 7 ms 1372 KB Output is correct
22 Correct 10 ms 1628 KB Output is correct
23 Correct 7 ms 1372 KB Output is correct
24 Correct 8 ms 3732 KB Output is correct
25 Correct 8 ms 3732 KB Output is correct
26 Correct 9 ms 1880 KB Output is correct
27 Correct 9 ms 1628 KB Output is correct
28 Correct 7 ms 1628 KB Output is correct
29 Correct 20 ms 3796 KB Output is correct
30 Correct 9 ms 2820 KB Output is correct
31 Correct 16 ms 3928 KB Output is correct
32 Correct 22 ms 3940 KB Output is correct
33 Correct 18 ms 3676 KB Output is correct
34 Correct 18 ms 9792 KB Output is correct
35 Correct 21 ms 9804 KB Output is correct
36 Correct 24 ms 4444 KB Output is correct
37 Correct 22 ms 4188 KB Output is correct
38 Correct 19 ms 3928 KB Output is correct
39 Correct 254 ms 41876 KB Output is correct
40 Correct 24 ms 4444 KB Output is correct
41 Correct 22 ms 11188 KB Output is correct
42 Correct 36 ms 6620 KB Output is correct
43 Correct 32 ms 9028 KB Output is correct
44 Correct 100 ms 17376 KB Output is correct
45 Correct 118 ms 20912 KB Output is correct
46 Correct 270 ms 42900 KB Output is correct
47 Correct 304 ms 42156 KB Output is correct
48 Correct 267 ms 41572 KB Output is correct
49 Correct 160 ms 89392 KB Output is correct
50 Correct 187 ms 88540 KB Output is correct
51 Correct 290 ms 44384 KB Output is correct
52 Correct 319 ms 42656 KB Output is correct
53 Correct 243 ms 41952 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 436 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 1 ms 600 KB Output is correct
63 Correct 1 ms 344 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 432 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 344 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 1 ms 344 KB Output is correct
78 Correct 1 ms 348 KB Output is correct
79 Correct 1 ms 344 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 348 KB Output is correct
86 Correct 1 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 1 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 1 ms 348 KB Output is correct
91 Correct 1 ms 612 KB Output is correct
92 Correct 1 ms 344 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 1 ms 352 KB Output is correct
95 Correct 1 ms 356 KB Output is correct
96 Correct 1 ms 352 KB Output is correct
97 Correct 1 ms 356 KB Output is correct
98 Correct 1 ms 356 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 348 KB Output is correct
102 Correct 1 ms 348 KB Output is correct
103 Correct 1 ms 600 KB Output is correct
104 Correct 1 ms 344 KB Output is correct
105 Correct 1 ms 344 KB Output is correct
106 Correct 1 ms 344 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 600 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 9 ms 1628 KB Output is correct
111 Correct 10 ms 2904 KB Output is correct
112 Correct 7 ms 1372 KB Output is correct
113 Correct 8 ms 1372 KB Output is correct
114 Correct 10 ms 1372 KB Output is correct
115 Correct 9 ms 1372 KB Output is correct
116 Correct 10 ms 1372 KB Output is correct
117 Correct 9 ms 1880 KB Output is correct
118 Correct 9 ms 1628 KB Output is correct
119 Correct 23 ms 6636 KB Output is correct
120 Correct 17 ms 3676 KB Output is correct
121 Correct 19 ms 3928 KB Output is correct
122 Correct 26 ms 3796 KB Output is correct
123 Correct 22 ms 3676 KB Output is correct
124 Correct 84 ms 22336 KB Output is correct
125 Correct 260 ms 57352 KB Output is correct
126 Correct 255 ms 42856 KB Output is correct
127 Correct 239 ms 42956 KB Output is correct
128 Correct 261 ms 41656 KB Output is correct
129 Correct 258 ms 41748 KB Output is correct
130 Correct 290 ms 74288 KB Output is correct
131 Correct 341 ms 76808 KB Output is correct
132 Correct 8 ms 1368 KB Output is correct
133 Correct 1 ms 348 KB Output is correct
134 Correct 1 ms 604 KB Output is correct
135 Correct 6 ms 1372 KB Output is correct
136 Correct 6 ms 3220 KB Output is correct
137 Correct 11 ms 2808 KB Output is correct
138 Correct 7 ms 1368 KB Output is correct
139 Correct 9 ms 1880 KB Output is correct
140 Correct 9 ms 1368 KB Output is correct
141 Correct 9 ms 1560 KB Output is correct
142 Correct 10 ms 1368 KB Output is correct
143 Correct 9 ms 1472 KB Output is correct
144 Correct 7 ms 3732 KB Output is correct
145 Correct 8 ms 3732 KB Output is correct
146 Correct 9 ms 2620 KB Output is correct
147 Correct 9 ms 1624 KB Output is correct
148 Correct 10 ms 1884 KB Output is correct
149 Correct 10 ms 1628 KB Output is correct
150 Correct 12 ms 1560 KB Output is correct
151 Correct 9 ms 1984 KB Output is correct
152 Correct 9 ms 1628 KB Output is correct
153 Correct 7 ms 1372 KB Output is correct
154 Correct 18 ms 3676 KB Output is correct
155 Correct 9 ms 2620 KB Output is correct
156 Correct 18 ms 6492 KB Output is correct
157 Correct 20 ms 3672 KB Output is correct
158 Correct 16 ms 3676 KB Output is correct
159 Correct 26 ms 4184 KB Output is correct
160 Correct 21 ms 3672 KB Output is correct
161 Correct 16 ms 3668 KB Output is correct
162 Correct 23 ms 3672 KB Output is correct
163 Correct 26 ms 3672 KB Output is correct
164 Correct 18 ms 9652 KB Output is correct
165 Correct 21 ms 9652 KB Output is correct
166 Correct 21 ms 6212 KB Output is correct
167 Correct 23 ms 3420 KB Output is correct
168 Correct 24 ms 3932 KB Output is correct
169 Correct 24 ms 3928 KB Output is correct
170 Correct 23 ms 3164 KB Output is correct
171 Correct 29 ms 4444 KB Output is correct
172 Correct 23 ms 4188 KB Output is correct
173 Correct 18 ms 3932 KB Output is correct
174 Correct 29 ms 4520 KB Output is correct
175 Correct 50 ms 7260 KB Output is correct
176 Correct 105 ms 22680 KB Output is correct
177 Correct 158 ms 19144 KB Output is correct
178 Correct 222 ms 24200 KB Output is correct
179 Correct 270 ms 27360 KB Output is correct
180 Correct 252 ms 27520 KB Output is correct
181 Correct 307 ms 28796 KB Output is correct
182 Correct 282 ms 33616 KB Output is correct
183 Correct 232 ms 33248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 432 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 8 ms 1372 KB Output is correct
20 Correct 6 ms 3216 KB Output is correct
21 Correct 7 ms 1372 KB Output is correct
22 Correct 10 ms 1628 KB Output is correct
23 Correct 7 ms 1372 KB Output is correct
24 Correct 8 ms 3732 KB Output is correct
25 Correct 8 ms 3732 KB Output is correct
26 Correct 9 ms 1880 KB Output is correct
27 Correct 9 ms 1628 KB Output is correct
28 Correct 7 ms 1628 KB Output is correct
29 Correct 20 ms 3796 KB Output is correct
30 Correct 9 ms 2820 KB Output is correct
31 Correct 16 ms 3928 KB Output is correct
32 Correct 22 ms 3940 KB Output is correct
33 Correct 18 ms 3676 KB Output is correct
34 Correct 18 ms 9792 KB Output is correct
35 Correct 21 ms 9804 KB Output is correct
36 Correct 24 ms 4444 KB Output is correct
37 Correct 22 ms 4188 KB Output is correct
38 Correct 19 ms 3928 KB Output is correct
39 Correct 254 ms 41876 KB Output is correct
40 Correct 24 ms 4444 KB Output is correct
41 Correct 22 ms 11188 KB Output is correct
42 Correct 36 ms 6620 KB Output is correct
43 Correct 32 ms 9028 KB Output is correct
44 Correct 100 ms 17376 KB Output is correct
45 Correct 118 ms 20912 KB Output is correct
46 Correct 270 ms 42900 KB Output is correct
47 Correct 304 ms 42156 KB Output is correct
48 Correct 267 ms 41572 KB Output is correct
49 Correct 160 ms 89392 KB Output is correct
50 Correct 187 ms 88540 KB Output is correct
51 Correct 290 ms 44384 KB Output is correct
52 Correct 319 ms 42656 KB Output is correct
53 Correct 243 ms 41952 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 436 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 1 ms 600 KB Output is correct
63 Correct 1 ms 344 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 432 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 344 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 1 ms 344 KB Output is correct
78 Correct 1 ms 348 KB Output is correct
79 Correct 1 ms 344 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 348 KB Output is correct
86 Correct 1 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 1 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 1 ms 348 KB Output is correct
91 Correct 1 ms 612 KB Output is correct
92 Correct 1 ms 344 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 1 ms 352 KB Output is correct
95 Correct 1 ms 356 KB Output is correct
96 Correct 1 ms 352 KB Output is correct
97 Correct 1 ms 356 KB Output is correct
98 Correct 1 ms 356 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 348 KB Output is correct
102 Correct 1 ms 348 KB Output is correct
103 Correct 1 ms 600 KB Output is correct
104 Correct 1 ms 344 KB Output is correct
105 Correct 1 ms 344 KB Output is correct
106 Correct 1 ms 344 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 600 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 9 ms 1628 KB Output is correct
111 Correct 10 ms 2904 KB Output is correct
112 Correct 7 ms 1372 KB Output is correct
113 Correct 8 ms 1372 KB Output is correct
114 Correct 10 ms 1372 KB Output is correct
115 Correct 9 ms 1372 KB Output is correct
116 Correct 10 ms 1372 KB Output is correct
117 Correct 9 ms 1880 KB Output is correct
118 Correct 9 ms 1628 KB Output is correct
119 Correct 23 ms 6636 KB Output is correct
120 Correct 17 ms 3676 KB Output is correct
121 Correct 19 ms 3928 KB Output is correct
122 Correct 26 ms 3796 KB Output is correct
123 Correct 22 ms 3676 KB Output is correct
124 Correct 84 ms 22336 KB Output is correct
125 Correct 260 ms 57352 KB Output is correct
126 Correct 255 ms 42856 KB Output is correct
127 Correct 239 ms 42956 KB Output is correct
128 Correct 261 ms 41656 KB Output is correct
129 Correct 258 ms 41748 KB Output is correct
130 Correct 290 ms 74288 KB Output is correct
131 Correct 341 ms 76808 KB Output is correct
132 Correct 8 ms 1368 KB Output is correct
133 Correct 1 ms 348 KB Output is correct
134 Correct 1 ms 604 KB Output is correct
135 Correct 6 ms 1372 KB Output is correct
136 Correct 6 ms 3220 KB Output is correct
137 Correct 11 ms 2808 KB Output is correct
138 Correct 7 ms 1368 KB Output is correct
139 Correct 9 ms 1880 KB Output is correct
140 Correct 9 ms 1368 KB Output is correct
141 Correct 9 ms 1560 KB Output is correct
142 Correct 10 ms 1368 KB Output is correct
143 Correct 9 ms 1472 KB Output is correct
144 Correct 7 ms 3732 KB Output is correct
145 Correct 8 ms 3732 KB Output is correct
146 Correct 9 ms 2620 KB Output is correct
147 Correct 9 ms 1624 KB Output is correct
148 Correct 10 ms 1884 KB Output is correct
149 Correct 10 ms 1628 KB Output is correct
150 Correct 12 ms 1560 KB Output is correct
151 Correct 9 ms 1984 KB Output is correct
152 Correct 9 ms 1628 KB Output is correct
153 Correct 7 ms 1372 KB Output is correct
154 Correct 18 ms 3676 KB Output is correct
155 Correct 9 ms 2620 KB Output is correct
156 Correct 18 ms 6492 KB Output is correct
157 Correct 20 ms 3672 KB Output is correct
158 Correct 16 ms 3676 KB Output is correct
159 Correct 26 ms 4184 KB Output is correct
160 Correct 21 ms 3672 KB Output is correct
161 Correct 16 ms 3668 KB Output is correct
162 Correct 23 ms 3672 KB Output is correct
163 Correct 26 ms 3672 KB Output is correct
164 Correct 18 ms 9652 KB Output is correct
165 Correct 21 ms 9652 KB Output is correct
166 Correct 21 ms 6212 KB Output is correct
167 Correct 23 ms 3420 KB Output is correct
168 Correct 24 ms 3932 KB Output is correct
169 Correct 24 ms 3928 KB Output is correct
170 Correct 23 ms 3164 KB Output is correct
171 Correct 29 ms 4444 KB Output is correct
172 Correct 23 ms 4188 KB Output is correct
173 Correct 18 ms 3932 KB Output is correct
174 Correct 29 ms 4520 KB Output is correct
175 Correct 50 ms 7260 KB Output is correct
176 Correct 105 ms 22680 KB Output is correct
177 Correct 158 ms 19144 KB Output is correct
178 Correct 222 ms 24200 KB Output is correct
179 Correct 270 ms 27360 KB Output is correct
180 Correct 252 ms 27520 KB Output is correct
181 Correct 307 ms 28796 KB Output is correct
182 Correct 282 ms 33616 KB Output is correct
183 Correct 232 ms 33248 KB Output is correct
184 Correct 523 ms 59428 KB Output is correct
185 Correct 268 ms 30180 KB Output is correct
186 Correct 387 ms 79552 KB Output is correct
187 Correct 426 ms 48896 KB Output is correct
188 Correct 488 ms 61984 KB Output is correct
189 Correct 649 ms 60116 KB Output is correct
190 Correct 483 ms 59732 KB Output is correct
191 Correct 444 ms 62036 KB Output is correct
192 Correct 523 ms 59780 KB Output is correct
193 Correct 563 ms 59784 KB Output is correct
194 Correct 333 ms 175468 KB Output is correct
195 Correct 398 ms 173544 KB Output is correct
196 Correct 513 ms 52920 KB Output is correct
197 Correct 503 ms 55840 KB Output is correct
198 Correct 500 ms 53316 KB Output is correct
199 Correct 567 ms 56496 KB Output is correct
200 Correct 674 ms 63076 KB Output is correct
201 Correct 590 ms 61136 KB Output is correct
202 Correct 519 ms 60164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 432 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 8 ms 1372 KB Output is correct
20 Correct 6 ms 3216 KB Output is correct
21 Correct 7 ms 1372 KB Output is correct
22 Correct 10 ms 1628 KB Output is correct
23 Correct 7 ms 1372 KB Output is correct
24 Correct 8 ms 3732 KB Output is correct
25 Correct 8 ms 3732 KB Output is correct
26 Correct 9 ms 1880 KB Output is correct
27 Correct 9 ms 1628 KB Output is correct
28 Correct 7 ms 1628 KB Output is correct
29 Correct 20 ms 3796 KB Output is correct
30 Correct 9 ms 2820 KB Output is correct
31 Correct 16 ms 3928 KB Output is correct
32 Correct 22 ms 3940 KB Output is correct
33 Correct 18 ms 3676 KB Output is correct
34 Correct 18 ms 9792 KB Output is correct
35 Correct 21 ms 9804 KB Output is correct
36 Correct 24 ms 4444 KB Output is correct
37 Correct 22 ms 4188 KB Output is correct
38 Correct 19 ms 3928 KB Output is correct
39 Correct 254 ms 41876 KB Output is correct
40 Correct 24 ms 4444 KB Output is correct
41 Correct 22 ms 11188 KB Output is correct
42 Correct 36 ms 6620 KB Output is correct
43 Correct 32 ms 9028 KB Output is correct
44 Correct 100 ms 17376 KB Output is correct
45 Correct 118 ms 20912 KB Output is correct
46 Correct 270 ms 42900 KB Output is correct
47 Correct 304 ms 42156 KB Output is correct
48 Correct 267 ms 41572 KB Output is correct
49 Correct 160 ms 89392 KB Output is correct
50 Correct 187 ms 88540 KB Output is correct
51 Correct 290 ms 44384 KB Output is correct
52 Correct 319 ms 42656 KB Output is correct
53 Correct 243 ms 41952 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 436 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 1 ms 600 KB Output is correct
63 Correct 1 ms 344 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 432 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 344 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 1 ms 344 KB Output is correct
78 Correct 1 ms 348 KB Output is correct
79 Correct 1 ms 344 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 348 KB Output is correct
86 Correct 1 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 1 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 1 ms 348 KB Output is correct
91 Correct 1 ms 612 KB Output is correct
92 Correct 1 ms 344 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 1 ms 352 KB Output is correct
95 Correct 1 ms 356 KB Output is correct
96 Correct 1 ms 352 KB Output is correct
97 Correct 1 ms 356 KB Output is correct
98 Correct 1 ms 356 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 348 KB Output is correct
102 Correct 1 ms 348 KB Output is correct
103 Correct 1 ms 600 KB Output is correct
104 Correct 1 ms 344 KB Output is correct
105 Correct 1 ms 344 KB Output is correct
106 Correct 1 ms 344 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 600 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 9 ms 1628 KB Output is correct
111 Correct 10 ms 2904 KB Output is correct
112 Correct 7 ms 1372 KB Output is correct
113 Correct 8 ms 1372 KB Output is correct
114 Correct 10 ms 1372 KB Output is correct
115 Correct 9 ms 1372 KB Output is correct
116 Correct 10 ms 1372 KB Output is correct
117 Correct 9 ms 1880 KB Output is correct
118 Correct 9 ms 1628 KB Output is correct
119 Correct 23 ms 6636 KB Output is correct
120 Correct 17 ms 3676 KB Output is correct
121 Correct 19 ms 3928 KB Output is correct
122 Correct 26 ms 3796 KB Output is correct
123 Correct 22 ms 3676 KB Output is correct
124 Correct 84 ms 22336 KB Output is correct
125 Correct 260 ms 57352 KB Output is correct
126 Correct 255 ms 42856 KB Output is correct
127 Correct 239 ms 42956 KB Output is correct
128 Correct 261 ms 41656 KB Output is correct
129 Correct 258 ms 41748 KB Output is correct
130 Correct 290 ms 74288 KB Output is correct
131 Correct 341 ms 76808 KB Output is correct
132 Correct 8 ms 1368 KB Output is correct
133 Correct 1 ms 348 KB Output is correct
134 Correct 1 ms 604 KB Output is correct
135 Correct 6 ms 1372 KB Output is correct
136 Correct 6 ms 3220 KB Output is correct
137 Correct 11 ms 2808 KB Output is correct
138 Correct 7 ms 1368 KB Output is correct
139 Correct 9 ms 1880 KB Output is correct
140 Correct 9 ms 1368 KB Output is correct
141 Correct 9 ms 1560 KB Output is correct
142 Correct 10 ms 1368 KB Output is correct
143 Correct 9 ms 1472 KB Output is correct
144 Correct 7 ms 3732 KB Output is correct
145 Correct 8 ms 3732 KB Output is correct
146 Correct 9 ms 2620 KB Output is correct
147 Correct 9 ms 1624 KB Output is correct
148 Correct 10 ms 1884 KB Output is correct
149 Correct 10 ms 1628 KB Output is correct
150 Correct 12 ms 1560 KB Output is correct
151 Correct 9 ms 1984 KB Output is correct
152 Correct 9 ms 1628 KB Output is correct
153 Correct 7 ms 1372 KB Output is correct
154 Correct 18 ms 3676 KB Output is correct
155 Correct 9 ms 2620 KB Output is correct
156 Correct 18 ms 6492 KB Output is correct
157 Correct 20 ms 3672 KB Output is correct
158 Correct 16 ms 3676 KB Output is correct
159 Correct 26 ms 4184 KB Output is correct
160 Correct 21 ms 3672 KB Output is correct
161 Correct 16 ms 3668 KB Output is correct
162 Correct 23 ms 3672 KB Output is correct
163 Correct 26 ms 3672 KB Output is correct
164 Correct 18 ms 9652 KB Output is correct
165 Correct 21 ms 9652 KB Output is correct
166 Correct 21 ms 6212 KB Output is correct
167 Correct 23 ms 3420 KB Output is correct
168 Correct 24 ms 3932 KB Output is correct
169 Correct 24 ms 3928 KB Output is correct
170 Correct 23 ms 3164 KB Output is correct
171 Correct 29 ms 4444 KB Output is correct
172 Correct 23 ms 4188 KB Output is correct
173 Correct 18 ms 3932 KB Output is correct
174 Correct 29 ms 4520 KB Output is correct
175 Correct 50 ms 7260 KB Output is correct
176 Correct 105 ms 22680 KB Output is correct
177 Correct 158 ms 19144 KB Output is correct
178 Correct 222 ms 24200 KB Output is correct
179 Correct 270 ms 27360 KB Output is correct
180 Correct 252 ms 27520 KB Output is correct
181 Correct 307 ms 28796 KB Output is correct
182 Correct 282 ms 33616 KB Output is correct
183 Correct 232 ms 33248 KB Output is correct
184 Correct 523 ms 59428 KB Output is correct
185 Correct 268 ms 30180 KB Output is correct
186 Correct 387 ms 79552 KB Output is correct
187 Correct 426 ms 48896 KB Output is correct
188 Correct 488 ms 61984 KB Output is correct
189 Correct 649 ms 60116 KB Output is correct
190 Correct 483 ms 59732 KB Output is correct
191 Correct 444 ms 62036 KB Output is correct
192 Correct 523 ms 59780 KB Output is correct
193 Correct 563 ms 59784 KB Output is correct
194 Correct 333 ms 175468 KB Output is correct
195 Correct 398 ms 173544 KB Output is correct
196 Correct 513 ms 52920 KB Output is correct
197 Correct 503 ms 55840 KB Output is correct
198 Correct 500 ms 53316 KB Output is correct
199 Correct 567 ms 56496 KB Output is correct
200 Correct 674 ms 63076 KB Output is correct
201 Correct 590 ms 61136 KB Output is correct
202 Correct 519 ms 60164 KB Output is correct
203 Correct 1083 ms 140780 KB Output is correct
204 Correct 582 ms 58204 KB Output is correct
205 Correct 694 ms 71760 KB Output is correct
206 Correct 809 ms 107848 KB Output is correct
207 Correct 1126 ms 146004 KB Output is correct
208 Correct 1298 ms 141708 KB Output is correct
209 Correct 1192 ms 140732 KB Output is correct
210 Correct 897 ms 146260 KB Output is correct
211 Correct 1026 ms 140904 KB Output is correct
212 Correct 1096 ms 141372 KB Output is correct
213 Correct 673 ms 346704 KB Output is correct
214 Correct 761 ms 346776 KB Output is correct
215 Correct 1030 ms 104512 KB Output is correct
216 Correct 1038 ms 105648 KB Output is correct
217 Correct 1076 ms 118308 KB Output is correct
218 Correct 1112 ms 104784 KB Output is correct
219 Correct 1118 ms 165604 KB Output is correct
220 Correct 1213 ms 224284 KB Output is correct
221 Correct 1268 ms 298584 KB Output is correct
222 Correct 1357 ms 313764 KB Output is correct
223 Correct 1322 ms 145580 KB Output is correct
224 Correct 1274 ms 143528 KB Output is correct
225 Correct 1094 ms 141488 KB Output is correct