답안 #935817

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
935817 2024-02-29T14:50:21 Z anton Maze (JOI23_ho_t3) C++17
51 / 100
2000 ms 30128 KB
#include<bits/stdc++.h>


using namespace std;
#define int long long
#define pii pair<int, int>

int R, C;
int N;

pii debut;
pii fin;

vector<vector<char>> maze;
vector<vector<int>> vis;

pii delta[4] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};

bool is_valid(pii pos){
    if(pos.first>=R || pos.first< 0){
        return false;
    }
    if(pos.second>=C || pos.second<0){
        return false;
    }
    return true;
}

vector<pii> get_free(pii pos){
    vector<pii> res;
    for(auto d: delta){
        pii c= {pos.first+d.first, pos.second+d.second};
        if(is_valid(c) && maze[c.first][c.second] != '#'){
            res.push_back(c);
        }
    }
    return res;
}

vector<pii> get_paid(pii pos){
    vector<pii> res;

    
    pii c= fin;
    if(is_valid(c)){
        if(abs(c.first-pos.first)<=N && abs(c.second-pos.second)<=N){
            if(abs(c.first-pos.first)<N || abs(c.second-pos.second)<N){
                res.push_back(c);
            }
        }
    }
    

    for(int i= -N; i<=N; i+=2*N){
        for(int j = -(N-1); j<=N-1; j++){
            pii c = {pos.first+i, pos.second+j};
            if(is_valid(c)){
                res.push_back(c);
            }
        }
    }

    for(int i= -N; i<=N; i+=2*N){
        for(int j = -(N-1); j<=N-1; j++){
            pii c = {pos.first+j, pos.second+i};
            if(is_valid(c)){
                res.push_back(c);
            }
        }
    }
    return res;
}


void display(){
    for(int i = 0; i<R; i++){
        for(int j = 0; j<C; j++){
            if(maze[i][j]=='.'){
                if(vis[i][j]){
                    cout<<'o';
                }
                else{
                    cout<<'.';
                }
            }
            else{
                if(vis[i][j]){
                    cout<<'O';
                }
                else{
                    cout<<'#';
                }
            }
        }
        cout<<endl;
    }
    cout<<endl;
}
int BFS(){
    deque<pair<pii, int>> dq;
    dq.push_back({debut, 0});
    vis[debut.first][debut.second] = 0;

    
    while(dq.size()>0){
        //display();
        auto cur= dq.front();
        dq.pop_front();
        pii cur_pos =cur.first;

        int dist = cur.second;
        if(dist!= vis[cur_pos.first][cur_pos.second]){
            continue;
        }

        //cout<<cur_pos.first<<" "<<cur_pos.second<<" "<<dist<<endl;
        //cout<<dist<<endl;

        if(cur_pos == fin){
            return dist;
        }
        
        for(auto e: get_free(cur_pos)){
            if(vis[e.first][e.second] > dist){
                vis[e.first][e.second] = dist;
                dq.push_front({e, dist});
            }
        }

        for(auto e: get_paid(cur_pos)){
            if(vis[e.first][e.second]>dist+1){
                vis[e.first][e.second] = dist+1;
                dq.push_back({e, dist+1});
            }
        }
    }
    return 1e9;

}

signed main(){
    cin>>R>>C;
    cin>>N;

    maze.resize(R, vector<char> (C));
    vis.resize(R, vector<int>(C, 1e9));

    cin>>debut.first>>debut.second;
    debut.first--;
    debut.second--;
    cin>>fin.first>>fin.second;
    fin.first--;
    fin.second--;

    
    for(int i = 0; i<R; i++){
        for(int j = 0; j<C; j++){
            cin>>maze[i][j];
        }
    }

    cout<<BFS()<<endl;

}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 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 348 KB Output is correct
9 Correct 1 ms 352 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 600 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 7 ms 860 KB Output is correct
20 Correct 5 ms 1116 KB Output is correct
21 Correct 4 ms 1116 KB Output is correct
22 Correct 14 ms 860 KB Output is correct
23 Correct 8 ms 860 KB Output is correct
24 Correct 8 ms 1372 KB Output is correct
25 Correct 6 ms 1368 KB Output is correct
26 Correct 3 ms 860 KB Output is correct
27 Correct 3 ms 988 KB Output is correct
28 Correct 5 ms 1004 KB Output is correct
29 Correct 20 ms 1628 KB Output is correct
30 Correct 9 ms 1116 KB Output is correct
31 Correct 13 ms 2908 KB Output is correct
32 Correct 26 ms 1820 KB Output is correct
33 Correct 18 ms 1628 KB Output is correct
34 Correct 20 ms 2760 KB Output is correct
35 Correct 17 ms 2760 KB Output is correct
36 Correct 16 ms 1884 KB Output is correct
37 Correct 22 ms 1892 KB Output is correct
38 Correct 6 ms 1880 KB Output is correct
39 Correct 202 ms 13660 KB Output is correct
40 Correct 12 ms 2016 KB Output is correct
41 Correct 16 ms 3492 KB Output is correct
42 Correct 33 ms 2140 KB Output is correct
43 Correct 33 ms 3420 KB Output is correct
44 Correct 62 ms 8028 KB Output is correct
45 Correct 64 ms 8636 KB Output is correct
46 Correct 86 ms 19764 KB Output is correct
47 Correct 250 ms 13656 KB Output is correct
48 Correct 155 ms 13660 KB Output is correct
49 Correct 153 ms 25244 KB Output is correct
50 Correct 118 ms 25244 KB Output is correct
51 Correct 205 ms 14792 KB Output is correct
52 Correct 154 ms 14020 KB Output is correct
53 Correct 173 ms 13840 KB Output is correct
# 결과 실행 시간 메모리 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 1 ms 348 KB Output is correct
12 Correct 0 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 0 ms 348 KB Output is correct
17 Correct 0 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 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 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 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 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 1 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 1 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 1 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 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 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 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 3 ms 604 KB Output is correct
26 Correct 21 ms 2396 KB Output is correct
27 Correct 4 ms 1368 KB Output is correct
28 Correct 78 ms 1616 KB Output is correct
29 Correct 2 ms 860 KB Output is correct
30 Correct 2 ms 860 KB Output is correct
31 Correct 43 ms 1168 KB Output is correct
32 Correct 4 ms 856 KB Output is correct
33 Correct 3 ms 860 KB Output is correct
34 Correct 184 ms 4960 KB Output is correct
35 Correct 13 ms 3160 KB Output is correct
36 Correct 289 ms 3600 KB Output is correct
37 Correct 6 ms 1884 KB Output is correct
38 Correct 5 ms 1884 KB Output is correct
39 Correct 400 ms 16632 KB Output is correct
40 Correct 331 ms 30128 KB Output is correct
41 Correct 87 ms 21328 KB Output is correct
42 Execution timed out 2048 ms 19904 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 1 ms 348 KB Output is correct
12 Correct 0 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 0 ms 348 KB Output is correct
17 Correct 0 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 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 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 0 ms 348 KB Output is correct
33 Correct 7 ms 1112 KB Output is correct
34 Correct 0 ms 344 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 3 ms 796 KB Output is correct
37 Correct 5 ms 1116 KB Output is correct
38 Correct 21 ms 2396 KB Output is correct
39 Correct 4 ms 1112 KB Output is correct
40 Correct 9 ms 856 KB Output is correct
41 Correct 8 ms 860 KB Output is correct
42 Correct 77 ms 1680 KB Output is correct
43 Correct 3 ms 860 KB Output is correct
44 Correct 2 ms 860 KB Output is correct
45 Correct 12 ms 1884 KB Output is correct
46 Correct 6 ms 1372 KB Output is correct
47 Correct 10 ms 1112 KB Output is correct
48 Correct 24 ms 860 KB Output is correct
49 Correct 30 ms 860 KB Output is correct
50 Correct 76 ms 1088 KB Output is correct
51 Correct 43 ms 1152 KB Output is correct
52 Correct 3 ms 860 KB Output is correct
53 Correct 3 ms 860 KB Output is correct
54 Correct 6 ms 1032 KB Output is correct
# 결과 실행 시간 메모리 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 1 ms 348 KB Output is correct
12 Correct 0 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 0 ms 348 KB Output is correct
17 Correct 0 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 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 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 0 ms 348 KB Output is correct
33 Correct 7 ms 1112 KB Output is correct
34 Correct 0 ms 344 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 3 ms 796 KB Output is correct
37 Correct 5 ms 1116 KB Output is correct
38 Correct 21 ms 2396 KB Output is correct
39 Correct 4 ms 1112 KB Output is correct
40 Correct 9 ms 856 KB Output is correct
41 Correct 8 ms 860 KB Output is correct
42 Correct 77 ms 1680 KB Output is correct
43 Correct 3 ms 860 KB Output is correct
44 Correct 2 ms 860 KB Output is correct
45 Correct 12 ms 1884 KB Output is correct
46 Correct 6 ms 1372 KB Output is correct
47 Correct 10 ms 1112 KB Output is correct
48 Correct 24 ms 860 KB Output is correct
49 Correct 30 ms 860 KB Output is correct
50 Correct 76 ms 1088 KB Output is correct
51 Correct 43 ms 1152 KB Output is correct
52 Correct 3 ms 860 KB Output is correct
53 Correct 3 ms 860 KB Output is correct
54 Correct 6 ms 1032 KB Output is correct
55 Correct 20 ms 1884 KB Output is correct
56 Correct 9 ms 1112 KB Output is correct
57 Correct 182 ms 4852 KB Output is correct
58 Correct 33 ms 1624 KB Output is correct
59 Correct 13 ms 3164 KB Output is correct
60 Correct 26 ms 1924 KB Output is correct
61 Correct 18 ms 1880 KB Output is correct
62 Correct 291 ms 3716 KB Output is correct
63 Correct 6 ms 1884 KB Output is correct
64 Correct 5 ms 1928 KB Output is correct
65 Correct 21 ms 2760 KB Output is correct
66 Correct 15 ms 2760 KB Output is correct
67 Correct 28 ms 2396 KB Output is correct
68 Correct 102 ms 2128 KB Output is correct
69 Correct 161 ms 1884 KB Output is correct
70 Correct 234 ms 2100 KB Output is correct
71 Correct 291 ms 2416 KB Output is correct
72 Correct 16 ms 1884 KB Output is correct
73 Correct 22 ms 1884 KB Output is correct
74 Correct 7 ms 1884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 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 348 KB Output is correct
9 Correct 1 ms 352 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 600 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 7 ms 860 KB Output is correct
20 Correct 5 ms 1116 KB Output is correct
21 Correct 4 ms 1116 KB Output is correct
22 Correct 14 ms 860 KB Output is correct
23 Correct 8 ms 860 KB Output is correct
24 Correct 8 ms 1372 KB Output is correct
25 Correct 6 ms 1368 KB Output is correct
26 Correct 3 ms 860 KB Output is correct
27 Correct 3 ms 988 KB Output is correct
28 Correct 5 ms 1004 KB Output is correct
29 Correct 20 ms 1628 KB Output is correct
30 Correct 9 ms 1116 KB Output is correct
31 Correct 13 ms 2908 KB Output is correct
32 Correct 26 ms 1820 KB Output is correct
33 Correct 18 ms 1628 KB Output is correct
34 Correct 20 ms 2760 KB Output is correct
35 Correct 17 ms 2760 KB Output is correct
36 Correct 16 ms 1884 KB Output is correct
37 Correct 22 ms 1892 KB Output is correct
38 Correct 6 ms 1880 KB Output is correct
39 Correct 202 ms 13660 KB Output is correct
40 Correct 12 ms 2016 KB Output is correct
41 Correct 16 ms 3492 KB Output is correct
42 Correct 33 ms 2140 KB Output is correct
43 Correct 33 ms 3420 KB Output is correct
44 Correct 62 ms 8028 KB Output is correct
45 Correct 64 ms 8636 KB Output is correct
46 Correct 86 ms 19764 KB Output is correct
47 Correct 250 ms 13656 KB Output is correct
48 Correct 155 ms 13660 KB Output is correct
49 Correct 153 ms 25244 KB Output is correct
50 Correct 118 ms 25244 KB Output is correct
51 Correct 205 ms 14792 KB Output is correct
52 Correct 154 ms 14020 KB Output is correct
53 Correct 173 ms 13840 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 1 ms 348 KB Output is correct
65 Correct 0 ms 344 KB Output is correct
66 Correct 0 ms 348 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 1 ms 348 KB Output is correct
72 Correct 1 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 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 344 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 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 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 0 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 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 344 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 1 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 3 ms 604 KB Output is correct
111 Correct 21 ms 2396 KB Output is correct
112 Correct 4 ms 1368 KB Output is correct
113 Correct 78 ms 1616 KB Output is correct
114 Correct 2 ms 860 KB Output is correct
115 Correct 2 ms 860 KB Output is correct
116 Correct 43 ms 1168 KB Output is correct
117 Correct 4 ms 856 KB Output is correct
118 Correct 3 ms 860 KB Output is correct
119 Correct 184 ms 4960 KB Output is correct
120 Correct 13 ms 3160 KB Output is correct
121 Correct 289 ms 3600 KB Output is correct
122 Correct 6 ms 1884 KB Output is correct
123 Correct 5 ms 1884 KB Output is correct
124 Correct 400 ms 16632 KB Output is correct
125 Correct 331 ms 30128 KB Output is correct
126 Correct 87 ms 21328 KB Output is correct
127 Execution timed out 2048 ms 19904 KB Time limit exceeded
128 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 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 348 KB Output is correct
9 Correct 1 ms 352 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 600 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 7 ms 860 KB Output is correct
20 Correct 5 ms 1116 KB Output is correct
21 Correct 4 ms 1116 KB Output is correct
22 Correct 14 ms 860 KB Output is correct
23 Correct 8 ms 860 KB Output is correct
24 Correct 8 ms 1372 KB Output is correct
25 Correct 6 ms 1368 KB Output is correct
26 Correct 3 ms 860 KB Output is correct
27 Correct 3 ms 988 KB Output is correct
28 Correct 5 ms 1004 KB Output is correct
29 Correct 20 ms 1628 KB Output is correct
30 Correct 9 ms 1116 KB Output is correct
31 Correct 13 ms 2908 KB Output is correct
32 Correct 26 ms 1820 KB Output is correct
33 Correct 18 ms 1628 KB Output is correct
34 Correct 20 ms 2760 KB Output is correct
35 Correct 17 ms 2760 KB Output is correct
36 Correct 16 ms 1884 KB Output is correct
37 Correct 22 ms 1892 KB Output is correct
38 Correct 6 ms 1880 KB Output is correct
39 Correct 202 ms 13660 KB Output is correct
40 Correct 12 ms 2016 KB Output is correct
41 Correct 16 ms 3492 KB Output is correct
42 Correct 33 ms 2140 KB Output is correct
43 Correct 33 ms 3420 KB Output is correct
44 Correct 62 ms 8028 KB Output is correct
45 Correct 64 ms 8636 KB Output is correct
46 Correct 86 ms 19764 KB Output is correct
47 Correct 250 ms 13656 KB Output is correct
48 Correct 155 ms 13660 KB Output is correct
49 Correct 153 ms 25244 KB Output is correct
50 Correct 118 ms 25244 KB Output is correct
51 Correct 205 ms 14792 KB Output is correct
52 Correct 154 ms 14020 KB Output is correct
53 Correct 173 ms 13840 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 1 ms 348 KB Output is correct
65 Correct 0 ms 344 KB Output is correct
66 Correct 0 ms 348 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 1 ms 348 KB Output is correct
72 Correct 1 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 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 344 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 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 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 0 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 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 344 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 1 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 3 ms 604 KB Output is correct
111 Correct 21 ms 2396 KB Output is correct
112 Correct 4 ms 1368 KB Output is correct
113 Correct 78 ms 1616 KB Output is correct
114 Correct 2 ms 860 KB Output is correct
115 Correct 2 ms 860 KB Output is correct
116 Correct 43 ms 1168 KB Output is correct
117 Correct 4 ms 856 KB Output is correct
118 Correct 3 ms 860 KB Output is correct
119 Correct 184 ms 4960 KB Output is correct
120 Correct 13 ms 3160 KB Output is correct
121 Correct 289 ms 3600 KB Output is correct
122 Correct 6 ms 1884 KB Output is correct
123 Correct 5 ms 1884 KB Output is correct
124 Correct 400 ms 16632 KB Output is correct
125 Correct 331 ms 30128 KB Output is correct
126 Correct 87 ms 21328 KB Output is correct
127 Execution timed out 2048 ms 19904 KB Time limit exceeded
128 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 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 348 KB Output is correct
9 Correct 1 ms 352 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 600 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 7 ms 860 KB Output is correct
20 Correct 5 ms 1116 KB Output is correct
21 Correct 4 ms 1116 KB Output is correct
22 Correct 14 ms 860 KB Output is correct
23 Correct 8 ms 860 KB Output is correct
24 Correct 8 ms 1372 KB Output is correct
25 Correct 6 ms 1368 KB Output is correct
26 Correct 3 ms 860 KB Output is correct
27 Correct 3 ms 988 KB Output is correct
28 Correct 5 ms 1004 KB Output is correct
29 Correct 20 ms 1628 KB Output is correct
30 Correct 9 ms 1116 KB Output is correct
31 Correct 13 ms 2908 KB Output is correct
32 Correct 26 ms 1820 KB Output is correct
33 Correct 18 ms 1628 KB Output is correct
34 Correct 20 ms 2760 KB Output is correct
35 Correct 17 ms 2760 KB Output is correct
36 Correct 16 ms 1884 KB Output is correct
37 Correct 22 ms 1892 KB Output is correct
38 Correct 6 ms 1880 KB Output is correct
39 Correct 202 ms 13660 KB Output is correct
40 Correct 12 ms 2016 KB Output is correct
41 Correct 16 ms 3492 KB Output is correct
42 Correct 33 ms 2140 KB Output is correct
43 Correct 33 ms 3420 KB Output is correct
44 Correct 62 ms 8028 KB Output is correct
45 Correct 64 ms 8636 KB Output is correct
46 Correct 86 ms 19764 KB Output is correct
47 Correct 250 ms 13656 KB Output is correct
48 Correct 155 ms 13660 KB Output is correct
49 Correct 153 ms 25244 KB Output is correct
50 Correct 118 ms 25244 KB Output is correct
51 Correct 205 ms 14792 KB Output is correct
52 Correct 154 ms 14020 KB Output is correct
53 Correct 173 ms 13840 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 1 ms 348 KB Output is correct
65 Correct 0 ms 344 KB Output is correct
66 Correct 0 ms 348 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 1 ms 348 KB Output is correct
72 Correct 1 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 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 344 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 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 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 0 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 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 344 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 1 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 3 ms 604 KB Output is correct
111 Correct 21 ms 2396 KB Output is correct
112 Correct 4 ms 1368 KB Output is correct
113 Correct 78 ms 1616 KB Output is correct
114 Correct 2 ms 860 KB Output is correct
115 Correct 2 ms 860 KB Output is correct
116 Correct 43 ms 1168 KB Output is correct
117 Correct 4 ms 856 KB Output is correct
118 Correct 3 ms 860 KB Output is correct
119 Correct 184 ms 4960 KB Output is correct
120 Correct 13 ms 3160 KB Output is correct
121 Correct 289 ms 3600 KB Output is correct
122 Correct 6 ms 1884 KB Output is correct
123 Correct 5 ms 1884 KB Output is correct
124 Correct 400 ms 16632 KB Output is correct
125 Correct 331 ms 30128 KB Output is correct
126 Correct 87 ms 21328 KB Output is correct
127 Execution timed out 2048 ms 19904 KB Time limit exceeded
128 Halted 0 ms 0 KB -