Submission #1046846

# Submission time Handle Problem Language Result Execution time Memory
1046846 2024-08-07T04:57:31 Z 1L1YA Maze (JOI23_ho_t3) C++17
62 / 100
279 ms 63792 KB
#include <bits/stdc++.h>
using namespace std;

using ll  = long long;
using ld  = long double;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
using ull = unsigned long long;

#define X               first
#define Y               second
#define SZ(x)           int(x.size())
#define all(x)          x.begin(), x.end()
#define mins(a,b)       (a = min(a,b))
#define maxs(a,b)       (a = max(a,b))
#define pb              push_back
#define Mp              make_pair
#define lc              id<<1
#define rc              lc|1
#define mid             ((l+r)/2)
mt19937_64              rng(chrono::steady_clock::now().time_since_epoch().count());

const ll  INF = 1e9 + 23;
const ll  MOD = 1e9 + 7;
const int MXN = 2e5 + 23;
const int LOG = 23;

int R, C, N, sr, sc, er, ec;
vector<vector<char>> a;
int dx4[4] = {-1, 0, 1, 0};
int dy4[4] = {0, 1, 0, -1};
int dx8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
vector<vector<int>> dis, dis4, dis8;
vector<pii> V, U;
int D;

bool in(int x, int y) {
    return 0<=x&&x<R && 0<=y&&y<C;
}

void BFS() {
    queue<pii> q;
    for(auto p : V) {
        dis[p.X][p.Y] = D;
        q.push(p);
    }
    while(SZ(q)) {
        int x = q.front().X, y = q.front().Y;
        q.pop();
        for(int d=0; d<4; d++) {
            int xx = x+dx4[d], yy = y+dy4[d];
            if(in(xx, yy) && a[xx][yy]=='.' && dis[xx][yy] == INF) {
                dis[xx][yy] = D;
                V.pb(Mp(xx, yy));
                q.push(Mp(xx, yy));
            }
        }
    }
}

void BFS8() {
    queue<pii> q;
    for(auto p : V) {
        dis8[p.X][p.Y] = 0;
        U.pb(p);
        q.push(p);
    }
    while(SZ(q)) {
        int x = q.front().X, y = q.front().Y;
        q.pop();
        if(dis8[x][y] == N) continue;
        for(int d=0; d<8; d++) {
            int xx = x+dx8[d], yy = y+dy8[d];
            if(in(xx, yy) && dis[xx][yy] == INF && dis8[x][y]+1<dis8[xx][yy]) {
                dis8[xx][yy] = dis8[x][y]+1;
                U.pb(Mp(xx, yy));
                q.push(Mp(xx, yy));
            }
        }
    }
}

void BFS4() {
    queue<pii> q;
    for(auto p : V) {
        dis4[p.X][p.Y] = 0;
        q.push(p);
    }
    while(SZ(q)) {
        int x = q.front().X, y = q.front().Y;
        q.pop();
        for(int d=0; d<4; d++) {
            int xx = x+dx4[d], yy = y+dy4[d];
            if(in(xx, yy) && dis[xx][yy] == INF && dis8[xx][yy] != INF && dis4[x][y]+1<dis4[xx][yy]) {
                dis4[xx][yy] = dis4[x][y]+1;
                q.push(Mp(xx, yy));
            }
        }
    }
}

void Upd() {
    V.clear();
    for(auto [x, y] : U) {
        if(dis[x][y] == INF && (dis8[x][y]<N || dis4[x][y]<N+N))
            V.pb(Mp(x, y));
        dis8[x][y] = dis4[x][y] = INF;
    }
    U.clear();
}

void SP() {
    V = {{sr, sc}};
    while(1) {
        BFS();
        BFS8();
        BFS4();
        Upd();
        if(V.empty()) break;
        D++;
    }
}

void Main() {
    cin >> R >> C >> N;
      cin >> sr >> sc >> er >> ec; sr--; sc--; er--; ec--;
    a = vector<vector<char>>(R, vector<char>(C));
    dis = vector<vector<int>>(R, vector<int>(C, INF));
    dis4 = vector<vector<int>>(R, vector<int>(C, INF));
    dis8 = vector<vector<int>>(R, vector<int>(C, INF));
    for(int r=0; r<R; r++)
        for(int c=0; c<C; c++)
            cin >> a[r][c];
    SP();
    cout << dis[er][ec] << '\n';
}

int32_t main() {
    cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
    int T = 1;
    // cin >> T;
    while(T--) Main();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 604 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 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 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 8 ms 1336 KB Output is correct
20 Correct 6 ms 1188 KB Output is correct
21 Correct 4 ms 2780 KB Output is correct
22 Correct 9 ms 1372 KB Output is correct
23 Correct 8 ms 1112 KB Output is correct
24 Correct 3 ms 1392 KB Output is correct
25 Correct 9 ms 1588 KB Output is correct
26 Correct 9 ms 1628 KB Output is correct
27 Correct 10 ms 1480 KB Output is correct
28 Correct 7 ms 1372 KB Output is correct
29 Correct 21 ms 2612 KB Output is correct
30 Correct 7 ms 1368 KB Output is correct
31 Correct 11 ms 7028 KB Output is correct
32 Correct 25 ms 2744 KB Output is correct
33 Correct 17 ms 2396 KB Output is correct
34 Correct 9 ms 2940 KB Output is correct
35 Correct 21 ms 2984 KB Output is correct
36 Correct 22 ms 3028 KB Output is correct
37 Correct 23 ms 2904 KB Output is correct
38 Correct 18 ms 2652 KB Output is correct
39 Correct 249 ms 21336 KB Output is correct
40 Correct 23 ms 2652 KB Output is correct
41 Correct 12 ms 3640 KB Output is correct
42 Correct 34 ms 3420 KB Output is correct
43 Correct 27 ms 4372 KB Output is correct
44 Correct 82 ms 11128 KB Output is correct
45 Correct 125 ms 12104 KB Output is correct
46 Correct 126 ms 61876 KB Output is correct
47 Correct 266 ms 21588 KB Output is correct
48 Correct 234 ms 21084 KB Output is correct
49 Correct 74 ms 26812 KB Output is correct
50 Correct 208 ms 26808 KB Output is correct
51 Correct 279 ms 22984 KB Output is correct
52 Correct 278 ms 21948 KB Output is correct
53 Correct 251 ms 21328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 364 KB Output is correct
28 Correct 1 ms 600 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 456 KB Output is correct
11 Correct 0 ms 460 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 5 ms 860 KB Output is correct
26 Correct 6 ms 2288 KB Output is correct
27 Correct 5 ms 2780 KB Output is correct
28 Correct 4 ms 2780 KB Output is correct
29 Correct 8 ms 2600 KB Output is correct
30 Correct 7 ms 2696 KB Output is correct
31 Correct 9 ms 1580 KB Output is correct
32 Correct 9 ms 1576 KB Output is correct
33 Correct 10 ms 1484 KB Output is correct
34 Correct 16 ms 4668 KB Output is correct
35 Correct 12 ms 6864 KB Output is correct
36 Correct 11 ms 6868 KB Output is correct
37 Correct 19 ms 6796 KB Output is correct
38 Correct 17 ms 6612 KB Output is correct
39 Correct 56 ms 16708 KB Output is correct
40 Correct 189 ms 50316 KB Output is correct
41 Correct 125 ms 63792 KB Output is correct
42 Correct 118 ms 63176 KB Output is correct
43 Correct 221 ms 60832 KB Output is correct
44 Correct 212 ms 59828 KB Output is correct
45 Correct 220 ms 53676 KB Output is correct
46 Correct 213 ms 55724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 364 KB Output is correct
28 Correct 1 ms 600 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 9 ms 1116 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 6 ms 1116 KB Output is correct
37 Correct 6 ms 1188 KB Output is correct
38 Correct 6 ms 2520 KB Output is correct
39 Correct 4 ms 2724 KB Output is correct
40 Correct 9 ms 1372 KB Output is correct
41 Correct 7 ms 1116 KB Output is correct
42 Correct 4 ms 2780 KB Output is correct
43 Correct 7 ms 2772 KB Output is correct
44 Correct 7 ms 2600 KB Output is correct
45 Correct 5 ms 1392 KB Output is correct
46 Correct 9 ms 1392 KB Output is correct
47 Correct 6 ms 1372 KB Output is correct
48 Correct 7 ms 1116 KB Output is correct
49 Correct 7 ms 1296 KB Output is correct
50 Correct 7 ms 1372 KB Output is correct
51 Correct 7 ms 1372 KB Output is correct
52 Correct 8 ms 1572 KB Output is correct
53 Correct 9 ms 1484 KB Output is correct
54 Correct 7 ms 1324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 364 KB Output is correct
28 Correct 1 ms 600 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 9 ms 1116 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 6 ms 1116 KB Output is correct
37 Correct 6 ms 1188 KB Output is correct
38 Correct 6 ms 2520 KB Output is correct
39 Correct 4 ms 2724 KB Output is correct
40 Correct 9 ms 1372 KB Output is correct
41 Correct 7 ms 1116 KB Output is correct
42 Correct 4 ms 2780 KB Output is correct
43 Correct 7 ms 2772 KB Output is correct
44 Correct 7 ms 2600 KB Output is correct
45 Correct 5 ms 1392 KB Output is correct
46 Correct 9 ms 1392 KB Output is correct
47 Correct 6 ms 1372 KB Output is correct
48 Correct 7 ms 1116 KB Output is correct
49 Correct 7 ms 1296 KB Output is correct
50 Correct 7 ms 1372 KB Output is correct
51 Correct 7 ms 1372 KB Output is correct
52 Correct 8 ms 1572 KB Output is correct
53 Correct 9 ms 1484 KB Output is correct
54 Correct 7 ms 1324 KB Output is correct
55 Correct 23 ms 2392 KB Output is correct
56 Correct 8 ms 1372 KB Output is correct
57 Correct 15 ms 4872 KB Output is correct
58 Incorrect 17 ms 2388 KB Output isn't correct
59 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 604 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 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 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 8 ms 1336 KB Output is correct
20 Correct 6 ms 1188 KB Output is correct
21 Correct 4 ms 2780 KB Output is correct
22 Correct 9 ms 1372 KB Output is correct
23 Correct 8 ms 1112 KB Output is correct
24 Correct 3 ms 1392 KB Output is correct
25 Correct 9 ms 1588 KB Output is correct
26 Correct 9 ms 1628 KB Output is correct
27 Correct 10 ms 1480 KB Output is correct
28 Correct 7 ms 1372 KB Output is correct
29 Correct 21 ms 2612 KB Output is correct
30 Correct 7 ms 1368 KB Output is correct
31 Correct 11 ms 7028 KB Output is correct
32 Correct 25 ms 2744 KB Output is correct
33 Correct 17 ms 2396 KB Output is correct
34 Correct 9 ms 2940 KB Output is correct
35 Correct 21 ms 2984 KB Output is correct
36 Correct 22 ms 3028 KB Output is correct
37 Correct 23 ms 2904 KB Output is correct
38 Correct 18 ms 2652 KB Output is correct
39 Correct 249 ms 21336 KB Output is correct
40 Correct 23 ms 2652 KB Output is correct
41 Correct 12 ms 3640 KB Output is correct
42 Correct 34 ms 3420 KB Output is correct
43 Correct 27 ms 4372 KB Output is correct
44 Correct 82 ms 11128 KB Output is correct
45 Correct 125 ms 12104 KB Output is correct
46 Correct 126 ms 61876 KB Output is correct
47 Correct 266 ms 21588 KB Output is correct
48 Correct 234 ms 21084 KB Output is correct
49 Correct 74 ms 26812 KB Output is correct
50 Correct 208 ms 26808 KB Output is correct
51 Correct 279 ms 22984 KB Output is correct
52 Correct 278 ms 21948 KB Output is correct
53 Correct 251 ms 21328 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 344 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 344 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 364 KB Output is correct
81 Correct 1 ms 600 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 456 KB Output is correct
96 Correct 0 ms 460 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 344 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 5 ms 860 KB Output is correct
111 Correct 6 ms 2288 KB Output is correct
112 Correct 5 ms 2780 KB Output is correct
113 Correct 4 ms 2780 KB Output is correct
114 Correct 8 ms 2600 KB Output is correct
115 Correct 7 ms 2696 KB Output is correct
116 Correct 9 ms 1580 KB Output is correct
117 Correct 9 ms 1576 KB Output is correct
118 Correct 10 ms 1484 KB Output is correct
119 Correct 16 ms 4668 KB Output is correct
120 Correct 12 ms 6864 KB Output is correct
121 Correct 11 ms 6868 KB Output is correct
122 Correct 19 ms 6796 KB Output is correct
123 Correct 17 ms 6612 KB Output is correct
124 Correct 56 ms 16708 KB Output is correct
125 Correct 189 ms 50316 KB Output is correct
126 Correct 125 ms 63792 KB Output is correct
127 Correct 118 ms 63176 KB Output is correct
128 Correct 221 ms 60832 KB Output is correct
129 Correct 212 ms 59828 KB Output is correct
130 Correct 220 ms 53676 KB Output is correct
131 Correct 213 ms 55724 KB Output is correct
132 Correct 9 ms 1116 KB Output is correct
133 Correct 0 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 6 ms 1116 KB Output is correct
136 Correct 6 ms 1188 KB Output is correct
137 Correct 6 ms 2520 KB Output is correct
138 Correct 4 ms 2724 KB Output is correct
139 Correct 9 ms 1372 KB Output is correct
140 Correct 7 ms 1116 KB Output is correct
141 Correct 4 ms 2780 KB Output is correct
142 Correct 7 ms 2772 KB Output is correct
143 Correct 7 ms 2600 KB Output is correct
144 Correct 5 ms 1392 KB Output is correct
145 Correct 9 ms 1392 KB Output is correct
146 Correct 6 ms 1372 KB Output is correct
147 Correct 7 ms 1116 KB Output is correct
148 Correct 7 ms 1296 KB Output is correct
149 Correct 7 ms 1372 KB Output is correct
150 Correct 7 ms 1372 KB Output is correct
151 Correct 8 ms 1572 KB Output is correct
152 Correct 9 ms 1484 KB Output is correct
153 Correct 7 ms 1324 KB Output is correct
154 Correct 23 ms 2392 KB Output is correct
155 Correct 8 ms 1372 KB Output is correct
156 Correct 15 ms 4872 KB Output is correct
157 Incorrect 17 ms 2388 KB Output isn't correct
158 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 604 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 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 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 8 ms 1336 KB Output is correct
20 Correct 6 ms 1188 KB Output is correct
21 Correct 4 ms 2780 KB Output is correct
22 Correct 9 ms 1372 KB Output is correct
23 Correct 8 ms 1112 KB Output is correct
24 Correct 3 ms 1392 KB Output is correct
25 Correct 9 ms 1588 KB Output is correct
26 Correct 9 ms 1628 KB Output is correct
27 Correct 10 ms 1480 KB Output is correct
28 Correct 7 ms 1372 KB Output is correct
29 Correct 21 ms 2612 KB Output is correct
30 Correct 7 ms 1368 KB Output is correct
31 Correct 11 ms 7028 KB Output is correct
32 Correct 25 ms 2744 KB Output is correct
33 Correct 17 ms 2396 KB Output is correct
34 Correct 9 ms 2940 KB Output is correct
35 Correct 21 ms 2984 KB Output is correct
36 Correct 22 ms 3028 KB Output is correct
37 Correct 23 ms 2904 KB Output is correct
38 Correct 18 ms 2652 KB Output is correct
39 Correct 249 ms 21336 KB Output is correct
40 Correct 23 ms 2652 KB Output is correct
41 Correct 12 ms 3640 KB Output is correct
42 Correct 34 ms 3420 KB Output is correct
43 Correct 27 ms 4372 KB Output is correct
44 Correct 82 ms 11128 KB Output is correct
45 Correct 125 ms 12104 KB Output is correct
46 Correct 126 ms 61876 KB Output is correct
47 Correct 266 ms 21588 KB Output is correct
48 Correct 234 ms 21084 KB Output is correct
49 Correct 74 ms 26812 KB Output is correct
50 Correct 208 ms 26808 KB Output is correct
51 Correct 279 ms 22984 KB Output is correct
52 Correct 278 ms 21948 KB Output is correct
53 Correct 251 ms 21328 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 344 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 344 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 364 KB Output is correct
81 Correct 1 ms 600 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 456 KB Output is correct
96 Correct 0 ms 460 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 344 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 5 ms 860 KB Output is correct
111 Correct 6 ms 2288 KB Output is correct
112 Correct 5 ms 2780 KB Output is correct
113 Correct 4 ms 2780 KB Output is correct
114 Correct 8 ms 2600 KB Output is correct
115 Correct 7 ms 2696 KB Output is correct
116 Correct 9 ms 1580 KB Output is correct
117 Correct 9 ms 1576 KB Output is correct
118 Correct 10 ms 1484 KB Output is correct
119 Correct 16 ms 4668 KB Output is correct
120 Correct 12 ms 6864 KB Output is correct
121 Correct 11 ms 6868 KB Output is correct
122 Correct 19 ms 6796 KB Output is correct
123 Correct 17 ms 6612 KB Output is correct
124 Correct 56 ms 16708 KB Output is correct
125 Correct 189 ms 50316 KB Output is correct
126 Correct 125 ms 63792 KB Output is correct
127 Correct 118 ms 63176 KB Output is correct
128 Correct 221 ms 60832 KB Output is correct
129 Correct 212 ms 59828 KB Output is correct
130 Correct 220 ms 53676 KB Output is correct
131 Correct 213 ms 55724 KB Output is correct
132 Correct 9 ms 1116 KB Output is correct
133 Correct 0 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 6 ms 1116 KB Output is correct
136 Correct 6 ms 1188 KB Output is correct
137 Correct 6 ms 2520 KB Output is correct
138 Correct 4 ms 2724 KB Output is correct
139 Correct 9 ms 1372 KB Output is correct
140 Correct 7 ms 1116 KB Output is correct
141 Correct 4 ms 2780 KB Output is correct
142 Correct 7 ms 2772 KB Output is correct
143 Correct 7 ms 2600 KB Output is correct
144 Correct 5 ms 1392 KB Output is correct
145 Correct 9 ms 1392 KB Output is correct
146 Correct 6 ms 1372 KB Output is correct
147 Correct 7 ms 1116 KB Output is correct
148 Correct 7 ms 1296 KB Output is correct
149 Correct 7 ms 1372 KB Output is correct
150 Correct 7 ms 1372 KB Output is correct
151 Correct 8 ms 1572 KB Output is correct
152 Correct 9 ms 1484 KB Output is correct
153 Correct 7 ms 1324 KB Output is correct
154 Correct 23 ms 2392 KB Output is correct
155 Correct 8 ms 1372 KB Output is correct
156 Correct 15 ms 4872 KB Output is correct
157 Incorrect 17 ms 2388 KB Output isn't correct
158 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 604 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 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 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 8 ms 1336 KB Output is correct
20 Correct 6 ms 1188 KB Output is correct
21 Correct 4 ms 2780 KB Output is correct
22 Correct 9 ms 1372 KB Output is correct
23 Correct 8 ms 1112 KB Output is correct
24 Correct 3 ms 1392 KB Output is correct
25 Correct 9 ms 1588 KB Output is correct
26 Correct 9 ms 1628 KB Output is correct
27 Correct 10 ms 1480 KB Output is correct
28 Correct 7 ms 1372 KB Output is correct
29 Correct 21 ms 2612 KB Output is correct
30 Correct 7 ms 1368 KB Output is correct
31 Correct 11 ms 7028 KB Output is correct
32 Correct 25 ms 2744 KB Output is correct
33 Correct 17 ms 2396 KB Output is correct
34 Correct 9 ms 2940 KB Output is correct
35 Correct 21 ms 2984 KB Output is correct
36 Correct 22 ms 3028 KB Output is correct
37 Correct 23 ms 2904 KB Output is correct
38 Correct 18 ms 2652 KB Output is correct
39 Correct 249 ms 21336 KB Output is correct
40 Correct 23 ms 2652 KB Output is correct
41 Correct 12 ms 3640 KB Output is correct
42 Correct 34 ms 3420 KB Output is correct
43 Correct 27 ms 4372 KB Output is correct
44 Correct 82 ms 11128 KB Output is correct
45 Correct 125 ms 12104 KB Output is correct
46 Correct 126 ms 61876 KB Output is correct
47 Correct 266 ms 21588 KB Output is correct
48 Correct 234 ms 21084 KB Output is correct
49 Correct 74 ms 26812 KB Output is correct
50 Correct 208 ms 26808 KB Output is correct
51 Correct 279 ms 22984 KB Output is correct
52 Correct 278 ms 21948 KB Output is correct
53 Correct 251 ms 21328 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 344 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 344 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 364 KB Output is correct
81 Correct 1 ms 600 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 456 KB Output is correct
96 Correct 0 ms 460 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 344 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 5 ms 860 KB Output is correct
111 Correct 6 ms 2288 KB Output is correct
112 Correct 5 ms 2780 KB Output is correct
113 Correct 4 ms 2780 KB Output is correct
114 Correct 8 ms 2600 KB Output is correct
115 Correct 7 ms 2696 KB Output is correct
116 Correct 9 ms 1580 KB Output is correct
117 Correct 9 ms 1576 KB Output is correct
118 Correct 10 ms 1484 KB Output is correct
119 Correct 16 ms 4668 KB Output is correct
120 Correct 12 ms 6864 KB Output is correct
121 Correct 11 ms 6868 KB Output is correct
122 Correct 19 ms 6796 KB Output is correct
123 Correct 17 ms 6612 KB Output is correct
124 Correct 56 ms 16708 KB Output is correct
125 Correct 189 ms 50316 KB Output is correct
126 Correct 125 ms 63792 KB Output is correct
127 Correct 118 ms 63176 KB Output is correct
128 Correct 221 ms 60832 KB Output is correct
129 Correct 212 ms 59828 KB Output is correct
130 Correct 220 ms 53676 KB Output is correct
131 Correct 213 ms 55724 KB Output is correct
132 Correct 9 ms 1116 KB Output is correct
133 Correct 0 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 6 ms 1116 KB Output is correct
136 Correct 6 ms 1188 KB Output is correct
137 Correct 6 ms 2520 KB Output is correct
138 Correct 4 ms 2724 KB Output is correct
139 Correct 9 ms 1372 KB Output is correct
140 Correct 7 ms 1116 KB Output is correct
141 Correct 4 ms 2780 KB Output is correct
142 Correct 7 ms 2772 KB Output is correct
143 Correct 7 ms 2600 KB Output is correct
144 Correct 5 ms 1392 KB Output is correct
145 Correct 9 ms 1392 KB Output is correct
146 Correct 6 ms 1372 KB Output is correct
147 Correct 7 ms 1116 KB Output is correct
148 Correct 7 ms 1296 KB Output is correct
149 Correct 7 ms 1372 KB Output is correct
150 Correct 7 ms 1372 KB Output is correct
151 Correct 8 ms 1572 KB Output is correct
152 Correct 9 ms 1484 KB Output is correct
153 Correct 7 ms 1324 KB Output is correct
154 Correct 23 ms 2392 KB Output is correct
155 Correct 8 ms 1372 KB Output is correct
156 Correct 15 ms 4872 KB Output is correct
157 Incorrect 17 ms 2388 KB Output isn't correct
158 Halted 0 ms 0 KB -