Submission #1094328

# Submission time Handle Problem Language Result Execution time Memory
1094328 2024-09-29T10:40:56 Z stefanopulos Maze (JOI23_ho_t3) C++17
27 / 100
2000 ms 249964 KB
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ldb;
 
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ldb,ldb> pdd;

#define ff(i,a,b) for(int i = a; i <= b; i++)
#define fb(i,b,a) for(int i = b; i >= a; i--)
#define trav(a,x) for(auto& a : x)
 
#define sz(a) (int)(a).size()
#define fi first
#define se second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

// os.order_of_key(k) the number of elements in the os less than k
// *os.find_by_order(k)  print the k-th smallest number in os(0-based)

const int mod = 1000000007;
const int inf = 1e9 + 5;
const int mxN = 200005; 

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

int n, m, k;
int Sx, Sy;
int Gx, Gy;

int main(){
    cin.tie(0)->sync_with_stdio(0);

    cin >> n >> m >> k >> Sx >> Sy >> Gx >> Gy;
    vector<string> s(n + 1);
    ff(i,1,n)cin >> s[i], s[i] = ' ' + s[i];

    vector<vector<vector<int>>> d(n + 1, vector<vector<int>>(m + 1, vector<int>(2)));
    ff(i,1,n)ff(j,1,m)ff(l,0,1)d[i][j][l] = inf;

    deque<array<int,3>> que; que.push_front({Sx, Sy, 0});
    d[Sx][Sy][0] = 0;

    while(sz(que)){
        auto [x, y, z] = que.front(); que.pop_front();

        if(z == 0){
            ff(i,0,3){
                int nwx = x + dx[i];
                int nwy = y + dy[i];
                if(nwx >= 1 && nwx <= n && nwy >= 1 && nwy <= m){
                    if(s[nwx][nwy] == '.'){
                        if(d[nwx][nwy][0] > d[x][y][0]){
                            d[nwx][nwy][0] = d[x][y][0];
                            que.push_front({nwx, nwy, 0});
                        }
                    }
                    else{
                        if(d[nwx][nwy][1] > d[x][y][0]){
                            d[nwx][nwy][1] = d[x][y][0];
                            que.push_front({nwx, nwy, 1});
                        }
                    }                    
                }
            }
        }
        else{
            ff(nwx,x - k + 1,x + k - 1){
                ff(nwy,y - k + 1,y + k - 1){
                    if(nwx >= 1 && nwx <= n && nwy >= 1 && nwy <= m){
                        if(d[nwx][nwy][0] > d[x][y][1] + 1){
                            d[nwx][nwy][0] = d[x][y][1] + 1;
                            que.push_back({nwx, nwy, 0});
                        }
                    }
                }
            }
        }

    }

    cout << d[Gx][Gy][0] << '\n';

    return 0;
}
/*

2 4 2
1 1
2 4
.###
###.

6 6 1
1 6
6 1
..#.#.
##.###
####.#
...###
##.##.
.#.###

6 7 6
6 4
3 1
..#.#.#
##.##..
.######
#..#.#.
.######
..#.##.

1 15 1
1 15
1 1
...............

// probati bojenje sahovski
*/
 
 
 
 
 
# Verdict Execution time Memory Grader output
1 Correct 1 ms 352 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 456 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 464 KB Output is correct
8 Correct 1 ms 604 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 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 600 KB Output is correct
19 Correct 6 ms 3676 KB Output is correct
20 Correct 8 ms 8028 KB Output is correct
21 Correct 8 ms 4188 KB Output is correct
22 Correct 7 ms 3676 KB Output is correct
23 Correct 9 ms 3672 KB Output is correct
24 Correct 9 ms 10328 KB Output is correct
25 Correct 17 ms 10332 KB Output is correct
26 Correct 7 ms 3796 KB Output is correct
27 Correct 7 ms 3932 KB Output is correct
28 Correct 7 ms 3752 KB Output is correct
29 Correct 16 ms 9052 KB Output is correct
30 Correct 8 ms 7256 KB Output is correct
31 Correct 12 ms 9792 KB Output is correct
32 Correct 20 ms 9052 KB Output is correct
33 Correct 21 ms 9048 KB Output is correct
34 Correct 31 ms 25240 KB Output is correct
35 Correct 26 ms 25172 KB Output is correct
36 Correct 20 ms 9052 KB Output is correct
37 Correct 26 ms 9100 KB Output is correct
38 Correct 27 ms 9064 KB Output is correct
39 Correct 249 ms 85844 KB Output is correct
40 Correct 19 ms 11196 KB Output is correct
41 Correct 28 ms 31012 KB Output is correct
42 Correct 29 ms 12764 KB Output is correct
43 Correct 32 ms 27348 KB Output is correct
44 Correct 90 ms 56012 KB Output is correct
45 Correct 98 ms 63292 KB Output is correct
46 Correct 145 ms 94988 KB Output is correct
47 Correct 202 ms 85844 KB Output is correct
48 Correct 273 ms 85844 KB Output is correct
49 Correct 232 ms 249964 KB Output is correct
50 Correct 246 ms 249900 KB Output is correct
51 Correct 226 ms 86140 KB Output is correct
52 Correct 254 ms 85840 KB Output is correct
53 Correct 237 ms 85884 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 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 5 ms 348 KB Output is correct
14 Correct 14 ms 536 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 1 ms 604 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 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 344 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 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 1 ms 348 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 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 0 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 344 KB Output is correct
10 Correct 5 ms 536 KB Output is correct
11 Correct 8 ms 536 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 456 KB Output is correct
17 Correct 1 ms 344 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 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 464 KB Output is correct
24 Correct 4 ms 604 KB Output is correct
25 Correct 8 ms 2700 KB Output is correct
26 Correct 11 ms 4168 KB Output is correct
27 Correct 5 ms 4188 KB Output is correct
28 Correct 280 ms 4956 KB Output is correct
29 Execution timed out 2061 ms 4444 KB Time limit exceeded
30 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 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 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 5 ms 348 KB Output is correct
14 Correct 14 ms 536 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 1 ms 604 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 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 344 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 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 6 ms 3672 KB Output is correct
34 Correct 4 ms 604 KB Output is correct
35 Correct 1 ms 860 KB Output is correct
36 Correct 7 ms 2652 KB Output is correct
37 Correct 9 ms 8028 KB Output is correct
38 Correct 9 ms 4184 KB Output is correct
39 Correct 9 ms 4184 KB Output is correct
40 Correct 6 ms 3676 KB Output is correct
41 Correct 6 ms 3676 KB Output is correct
42 Correct 337 ms 4968 KB Output is correct
43 Execution timed out 2033 ms 4444 KB Time limit exceeded
44 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 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 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 5 ms 348 KB Output is correct
14 Correct 14 ms 536 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 1 ms 604 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 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 344 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 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 6 ms 3672 KB Output is correct
34 Correct 4 ms 604 KB Output is correct
35 Correct 1 ms 860 KB Output is correct
36 Correct 7 ms 2652 KB Output is correct
37 Correct 9 ms 8028 KB Output is correct
38 Correct 9 ms 4184 KB Output is correct
39 Correct 9 ms 4184 KB Output is correct
40 Correct 6 ms 3676 KB Output is correct
41 Correct 6 ms 3676 KB Output is correct
42 Correct 337 ms 4968 KB Output is correct
43 Execution timed out 2033 ms 4444 KB Time limit exceeded
44 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 352 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 456 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 464 KB Output is correct
8 Correct 1 ms 604 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 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 600 KB Output is correct
19 Correct 6 ms 3676 KB Output is correct
20 Correct 8 ms 8028 KB Output is correct
21 Correct 8 ms 4188 KB Output is correct
22 Correct 7 ms 3676 KB Output is correct
23 Correct 9 ms 3672 KB Output is correct
24 Correct 9 ms 10328 KB Output is correct
25 Correct 17 ms 10332 KB Output is correct
26 Correct 7 ms 3796 KB Output is correct
27 Correct 7 ms 3932 KB Output is correct
28 Correct 7 ms 3752 KB Output is correct
29 Correct 16 ms 9052 KB Output is correct
30 Correct 8 ms 7256 KB Output is correct
31 Correct 12 ms 9792 KB Output is correct
32 Correct 20 ms 9052 KB Output is correct
33 Correct 21 ms 9048 KB Output is correct
34 Correct 31 ms 25240 KB Output is correct
35 Correct 26 ms 25172 KB Output is correct
36 Correct 20 ms 9052 KB Output is correct
37 Correct 26 ms 9100 KB Output is correct
38 Correct 27 ms 9064 KB Output is correct
39 Correct 249 ms 85844 KB Output is correct
40 Correct 19 ms 11196 KB Output is correct
41 Correct 28 ms 31012 KB Output is correct
42 Correct 29 ms 12764 KB Output is correct
43 Correct 32 ms 27348 KB Output is correct
44 Correct 90 ms 56012 KB Output is correct
45 Correct 98 ms 63292 KB Output is correct
46 Correct 145 ms 94988 KB Output is correct
47 Correct 202 ms 85844 KB Output is correct
48 Correct 273 ms 85844 KB Output is correct
49 Correct 232 ms 249964 KB Output is correct
50 Correct 246 ms 249900 KB Output is correct
51 Correct 226 ms 86140 KB Output is correct
52 Correct 254 ms 85840 KB Output is correct
53 Correct 237 ms 85884 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 1 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 1 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 344 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 344 KB Output is correct
66 Correct 5 ms 348 KB Output is correct
67 Correct 14 ms 536 KB Output is correct
68 Correct 1 ms 604 KB Output is correct
69 Correct 1 ms 604 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 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 344 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 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 ms 348 KB Output is correct
86 Correct 1 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 344 KB Output is correct
90 Correct 1 ms 460 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 1 ms 344 KB Output is correct
95 Correct 5 ms 536 KB Output is correct
96 Correct 8 ms 536 KB Output is correct
97 Correct 1 ms 604 KB Output is correct
98 Correct 1 ms 344 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 456 KB Output is correct
102 Correct 1 ms 344 KB Output is correct
103 Correct 1 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 1 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 464 KB Output is correct
109 Correct 4 ms 604 KB Output is correct
110 Correct 8 ms 2700 KB Output is correct
111 Correct 11 ms 4168 KB Output is correct
112 Correct 5 ms 4188 KB Output is correct
113 Correct 280 ms 4956 KB Output is correct
114 Execution timed out 2061 ms 4444 KB Time limit exceeded
115 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 352 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 456 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 464 KB Output is correct
8 Correct 1 ms 604 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 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 600 KB Output is correct
19 Correct 6 ms 3676 KB Output is correct
20 Correct 8 ms 8028 KB Output is correct
21 Correct 8 ms 4188 KB Output is correct
22 Correct 7 ms 3676 KB Output is correct
23 Correct 9 ms 3672 KB Output is correct
24 Correct 9 ms 10328 KB Output is correct
25 Correct 17 ms 10332 KB Output is correct
26 Correct 7 ms 3796 KB Output is correct
27 Correct 7 ms 3932 KB Output is correct
28 Correct 7 ms 3752 KB Output is correct
29 Correct 16 ms 9052 KB Output is correct
30 Correct 8 ms 7256 KB Output is correct
31 Correct 12 ms 9792 KB Output is correct
32 Correct 20 ms 9052 KB Output is correct
33 Correct 21 ms 9048 KB Output is correct
34 Correct 31 ms 25240 KB Output is correct
35 Correct 26 ms 25172 KB Output is correct
36 Correct 20 ms 9052 KB Output is correct
37 Correct 26 ms 9100 KB Output is correct
38 Correct 27 ms 9064 KB Output is correct
39 Correct 249 ms 85844 KB Output is correct
40 Correct 19 ms 11196 KB Output is correct
41 Correct 28 ms 31012 KB Output is correct
42 Correct 29 ms 12764 KB Output is correct
43 Correct 32 ms 27348 KB Output is correct
44 Correct 90 ms 56012 KB Output is correct
45 Correct 98 ms 63292 KB Output is correct
46 Correct 145 ms 94988 KB Output is correct
47 Correct 202 ms 85844 KB Output is correct
48 Correct 273 ms 85844 KB Output is correct
49 Correct 232 ms 249964 KB Output is correct
50 Correct 246 ms 249900 KB Output is correct
51 Correct 226 ms 86140 KB Output is correct
52 Correct 254 ms 85840 KB Output is correct
53 Correct 237 ms 85884 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 1 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 1 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 344 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 344 KB Output is correct
66 Correct 5 ms 348 KB Output is correct
67 Correct 14 ms 536 KB Output is correct
68 Correct 1 ms 604 KB Output is correct
69 Correct 1 ms 604 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 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 344 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 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 ms 348 KB Output is correct
86 Correct 1 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 344 KB Output is correct
90 Correct 1 ms 460 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 1 ms 344 KB Output is correct
95 Correct 5 ms 536 KB Output is correct
96 Correct 8 ms 536 KB Output is correct
97 Correct 1 ms 604 KB Output is correct
98 Correct 1 ms 344 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 456 KB Output is correct
102 Correct 1 ms 344 KB Output is correct
103 Correct 1 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 1 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 464 KB Output is correct
109 Correct 4 ms 604 KB Output is correct
110 Correct 8 ms 2700 KB Output is correct
111 Correct 11 ms 4168 KB Output is correct
112 Correct 5 ms 4188 KB Output is correct
113 Correct 280 ms 4956 KB Output is correct
114 Execution timed out 2061 ms 4444 KB Time limit exceeded
115 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 352 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 456 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 464 KB Output is correct
8 Correct 1 ms 604 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 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 600 KB Output is correct
19 Correct 6 ms 3676 KB Output is correct
20 Correct 8 ms 8028 KB Output is correct
21 Correct 8 ms 4188 KB Output is correct
22 Correct 7 ms 3676 KB Output is correct
23 Correct 9 ms 3672 KB Output is correct
24 Correct 9 ms 10328 KB Output is correct
25 Correct 17 ms 10332 KB Output is correct
26 Correct 7 ms 3796 KB Output is correct
27 Correct 7 ms 3932 KB Output is correct
28 Correct 7 ms 3752 KB Output is correct
29 Correct 16 ms 9052 KB Output is correct
30 Correct 8 ms 7256 KB Output is correct
31 Correct 12 ms 9792 KB Output is correct
32 Correct 20 ms 9052 KB Output is correct
33 Correct 21 ms 9048 KB Output is correct
34 Correct 31 ms 25240 KB Output is correct
35 Correct 26 ms 25172 KB Output is correct
36 Correct 20 ms 9052 KB Output is correct
37 Correct 26 ms 9100 KB Output is correct
38 Correct 27 ms 9064 KB Output is correct
39 Correct 249 ms 85844 KB Output is correct
40 Correct 19 ms 11196 KB Output is correct
41 Correct 28 ms 31012 KB Output is correct
42 Correct 29 ms 12764 KB Output is correct
43 Correct 32 ms 27348 KB Output is correct
44 Correct 90 ms 56012 KB Output is correct
45 Correct 98 ms 63292 KB Output is correct
46 Correct 145 ms 94988 KB Output is correct
47 Correct 202 ms 85844 KB Output is correct
48 Correct 273 ms 85844 KB Output is correct
49 Correct 232 ms 249964 KB Output is correct
50 Correct 246 ms 249900 KB Output is correct
51 Correct 226 ms 86140 KB Output is correct
52 Correct 254 ms 85840 KB Output is correct
53 Correct 237 ms 85884 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 1 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 1 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 344 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 344 KB Output is correct
66 Correct 5 ms 348 KB Output is correct
67 Correct 14 ms 536 KB Output is correct
68 Correct 1 ms 604 KB Output is correct
69 Correct 1 ms 604 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 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 344 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 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 ms 348 KB Output is correct
86 Correct 1 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 344 KB Output is correct
90 Correct 1 ms 460 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 1 ms 344 KB Output is correct
95 Correct 5 ms 536 KB Output is correct
96 Correct 8 ms 536 KB Output is correct
97 Correct 1 ms 604 KB Output is correct
98 Correct 1 ms 344 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 ms 456 KB Output is correct
102 Correct 1 ms 344 KB Output is correct
103 Correct 1 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 1 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 464 KB Output is correct
109 Correct 4 ms 604 KB Output is correct
110 Correct 8 ms 2700 KB Output is correct
111 Correct 11 ms 4168 KB Output is correct
112 Correct 5 ms 4188 KB Output is correct
113 Correct 280 ms 4956 KB Output is correct
114 Execution timed out 2061 ms 4444 KB Time limit exceeded
115 Halted 0 ms 0 KB -