답안 #736313

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
736313 2023-05-05T12:33:33 Z Cookie Maze (JOI23_ho_t3) C++14
86 / 100
2000 ms 297416 KB
#include<bits/stdc++.h>
#include<fstream>
using namespace std;
ifstream fin("WINTER.inp");
ofstream fout("WINTER.out");

#define ll long long
#define pb push_back
#define forr(i, a, b) for(int i = a; i < b; i++)
#define dorr(i, a, b) for(int i = a; i >= b; i--)
#define ld long double
#define vt vector
#include<fstream>
#define fi first
#define se second
#define pll pair<ll, ll>
#define pii pair<int, int>
const ld PI = 3.14159265359;
const int x[4] = {1, -1, 0, 0};
const int y[4] = {0, 0, 1, -1};
const ll mod = 1e9 + 7;
const int mxn = 5e5, mxm = 1e5, sq = 400;
const int base = (1 << 18);
const ll inf = 1e9;
const ld pre = 1e-6;
int r, c, n, sti, stj, eni, enj;
vt<vt<char>>a;
vt<vt<int>>d;
vt<set<int>>row, col;
bool inside(int i, int j){
    return(i >= 1 && j >= 1 && i <= r && j <= c);
}
signed main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> r >> c >> n;
    a.resize(r + 1, vt<char>(c + 1));
    d.resize(r + 1, vt<int>(c + 1));
   
    cin >> sti >> stj >> eni >> enj;
    row.resize(r + 1); col.resize(c + 1);
    forr(i, 1, r + 1){
        forr(j, 1, c + 1){
            cin >> a[i][j]; d[i][j] = 1e9;
            row[i].insert(j); col[j].insert(i);
        }
    }
    
    deque<pair<int, int>>dq; dq.pb({sti, stj});
    d[sti][stj] = 0;
    while(!dq.empty()){
        auto [i, j] = dq.front(); dq.pop_front();
        
        if(a[i][j] == '.'){
        for(int t = 0; t < 4; t++){
            int nwi = i + x[t], nwj = j + y[t];
            if(inside(nwi, nwj)){
                if(d[nwi][nwj] > d[i][j]){
                    d[nwi][nwj] = d[i][j];
                    dq.push_front({nwi, nwj});
                }
            }
        }
        }
        for(auto ii: {i - n, i + n}){
            vt<int>rem;
            if(!inside(ii, 1))continue;
            auto it = row[ii].lower_bound(j - n + 1), it2 = row[ii].upper_bound(j + n - 1);
            if(it == row[ii].end())continue;
            for(auto iter = it; iter != it2; iter++){
                int jj = *iter;
                if(d[ii][jj] > d[i][j] + 1){
                        d[ii][jj] = d[i][j] + 1;
                        dq.push_back({ii, jj});
                }
                rem.pb(jj);
            }
            for(auto jj: rem){
                row[ii].erase(jj); col[jj].erase(ii);
            }
        }
        for(auto jj : {j - n, j + n}){
            vt<int>rem;
            if(!inside(1, jj))continue;
            auto it = col[jj].lower_bound(i - n + 1), it2 = col[jj].upper_bound(i + n - 1);
            if(it == col[jj].end())continue;
            for(auto iter = it; iter != it2; iter++){
                int ii = *iter;
                if(d[ii][jj] > d[i][j] + 1){
                        d[ii][jj] = d[i][j] + 1;
                        dq.push_back({ii, jj});
                }
                rem.pb(ii);
            }
            for(auto ii: rem){
                row[ii].erase(jj); col[jj].erase(ii);
            }
        }
    }
    int ans = 1e9;
    for(int i = eni - n + 1; i <= eni + n - 1; i++){
        for(int j = enj - n + 1; j  <= enj + n - 1; j++){
            if(inside(i, j)){
                
                ans = min(ans, d[i][j] + 1);
            }
        }
    }
    ans = min(ans, d[eni][enj]);
    cout << ans;
    return(0);
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:51:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   51 |         auto [i, j] = dq.front(); dq.pop_front();
      |              ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 1 ms 328 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 456 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 38 ms 6316 KB Output is correct
20 Correct 20 ms 7324 KB Output is correct
21 Correct 31 ms 6296 KB Output is correct
22 Correct 40 ms 6332 KB Output is correct
23 Correct 47 ms 6316 KB Output is correct
24 Correct 34 ms 9424 KB Output is correct
25 Correct 27 ms 9312 KB Output is correct
26 Correct 40 ms 6300 KB Output is correct
27 Correct 42 ms 6292 KB Output is correct
28 Correct 35 ms 6220 KB Output is correct
29 Correct 100 ms 15108 KB Output is correct
30 Correct 36 ms 7904 KB Output is correct
31 Correct 69 ms 15212 KB Output is correct
32 Correct 113 ms 15304 KB Output is correct
33 Correct 98 ms 15212 KB Output is correct
34 Correct 76 ms 22964 KB Output is correct
35 Correct 70 ms 22944 KB Output is correct
36 Correct 115 ms 15340 KB Output is correct
37 Correct 116 ms 15244 KB Output is correct
38 Correct 95 ms 15320 KB Output is correct
39 Correct 1278 ms 148872 KB Output is correct
40 Correct 118 ms 17608 KB Output is correct
41 Correct 100 ms 28116 KB Output is correct
42 Correct 144 ms 21584 KB Output is correct
43 Correct 147 ms 30592 KB Output is correct
44 Correct 667 ms 80316 KB Output is correct
45 Correct 562 ms 88084 KB Output is correct
46 Correct 834 ms 148992 KB Output is correct
47 Correct 1192 ms 149012 KB Output is correct
48 Correct 1493 ms 149924 KB Output is correct
49 Correct 898 ms 227568 KB Output is correct
50 Correct 1043 ms 227896 KB Output is correct
51 Correct 1420 ms 150024 KB Output is correct
52 Correct 1407 ms 149724 KB Output is correct
53 Correct 1646 ms 149860 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 328 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 328 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 328 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 324 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 328 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 328 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 324 KB Output is correct
4 Correct 1 ms 324 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 324 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 468 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 324 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 2 ms 468 KB Output is correct
25 Correct 21 ms 4044 KB Output is correct
26 Correct 30 ms 5680 KB Output is correct
27 Correct 27 ms 6228 KB Output is correct
28 Correct 20 ms 6484 KB Output is correct
29 Correct 20 ms 6228 KB Output is correct
30 Correct 18 ms 6296 KB Output is correct
31 Correct 27 ms 6380 KB Output is correct
32 Correct 47 ms 6344 KB Output is correct
33 Correct 42 ms 6336 KB Output is correct
34 Correct 67 ms 12236 KB Output is correct
35 Correct 74 ms 15328 KB Output is correct
36 Correct 54 ms 15752 KB Output is correct
37 Correct 49 ms 15320 KB Output is correct
38 Correct 55 ms 15240 KB Output is correct
39 Correct 246 ms 43680 KB Output is correct
40 Correct 785 ms 127544 KB Output is correct
41 Correct 805 ms 150200 KB Output is correct
42 Correct 696 ms 153452 KB Output is correct
43 Correct 716 ms 150084 KB Output is correct
44 Correct 648 ms 150196 KB Output is correct
45 Correct 991 ms 151088 KB Output is correct
46 Correct 1122 ms 150588 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 328 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 328 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 328 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 324 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 328 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 328 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 36 ms 6228 KB Output is correct
34 Correct 1 ms 468 KB Output is correct
35 Correct 3 ms 852 KB Output is correct
36 Correct 31 ms 4052 KB Output is correct
37 Correct 22 ms 7340 KB Output is correct
38 Correct 29 ms 5708 KB Output is correct
39 Correct 30 ms 6356 KB Output is correct
40 Correct 43 ms 6320 KB Output is correct
41 Correct 46 ms 6316 KB Output is correct
42 Correct 24 ms 6484 KB Output is correct
43 Correct 24 ms 6304 KB Output is correct
44 Correct 16 ms 6228 KB Output is correct
45 Correct 30 ms 9436 KB Output is correct
46 Correct 28 ms 9420 KB Output is correct
47 Correct 36 ms 7840 KB Output is correct
48 Correct 25 ms 6496 KB Output is correct
49 Correct 24 ms 6356 KB Output is correct
50 Correct 30 ms 6416 KB Output is correct
51 Correct 27 ms 6340 KB Output is correct
52 Correct 46 ms 6228 KB Output is correct
53 Correct 43 ms 6252 KB Output is correct
54 Correct 37 ms 6252 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 328 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 328 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 328 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 324 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 328 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 328 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 36 ms 6228 KB Output is correct
34 Correct 1 ms 468 KB Output is correct
35 Correct 3 ms 852 KB Output is correct
36 Correct 31 ms 4052 KB Output is correct
37 Correct 22 ms 7340 KB Output is correct
38 Correct 29 ms 5708 KB Output is correct
39 Correct 30 ms 6356 KB Output is correct
40 Correct 43 ms 6320 KB Output is correct
41 Correct 46 ms 6316 KB Output is correct
42 Correct 24 ms 6484 KB Output is correct
43 Correct 24 ms 6304 KB Output is correct
44 Correct 16 ms 6228 KB Output is correct
45 Correct 30 ms 9436 KB Output is correct
46 Correct 28 ms 9420 KB Output is correct
47 Correct 36 ms 7840 KB Output is correct
48 Correct 25 ms 6496 KB Output is correct
49 Correct 24 ms 6356 KB Output is correct
50 Correct 30 ms 6416 KB Output is correct
51 Correct 27 ms 6340 KB Output is correct
52 Correct 46 ms 6228 KB Output is correct
53 Correct 43 ms 6252 KB Output is correct
54 Correct 37 ms 6252 KB Output is correct
55 Correct 92 ms 15308 KB Output is correct
56 Correct 38 ms 8008 KB Output is correct
57 Correct 57 ms 12492 KB Output is correct
58 Correct 91 ms 14488 KB Output is correct
59 Correct 77 ms 15324 KB Output is correct
60 Correct 120 ms 15328 KB Output is correct
61 Correct 97 ms 15324 KB Output is correct
62 Correct 57 ms 15960 KB Output is correct
63 Correct 63 ms 15312 KB Output is correct
64 Correct 65 ms 15300 KB Output is correct
65 Correct 72 ms 23024 KB Output is correct
66 Correct 75 ms 23056 KB Output is correct
67 Correct 75 ms 19108 KB Output is correct
68 Correct 88 ms 15608 KB Output is correct
69 Correct 69 ms 15512 KB Output is correct
70 Correct 78 ms 15436 KB Output is correct
71 Correct 80 ms 15404 KB Output is correct
72 Correct 112 ms 15320 KB Output is correct
73 Correct 111 ms 15436 KB Output is correct
74 Correct 92 ms 15300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 1 ms 328 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 456 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 38 ms 6316 KB Output is correct
20 Correct 20 ms 7324 KB Output is correct
21 Correct 31 ms 6296 KB Output is correct
22 Correct 40 ms 6332 KB Output is correct
23 Correct 47 ms 6316 KB Output is correct
24 Correct 34 ms 9424 KB Output is correct
25 Correct 27 ms 9312 KB Output is correct
26 Correct 40 ms 6300 KB Output is correct
27 Correct 42 ms 6292 KB Output is correct
28 Correct 35 ms 6220 KB Output is correct
29 Correct 100 ms 15108 KB Output is correct
30 Correct 36 ms 7904 KB Output is correct
31 Correct 69 ms 15212 KB Output is correct
32 Correct 113 ms 15304 KB Output is correct
33 Correct 98 ms 15212 KB Output is correct
34 Correct 76 ms 22964 KB Output is correct
35 Correct 70 ms 22944 KB Output is correct
36 Correct 115 ms 15340 KB Output is correct
37 Correct 116 ms 15244 KB Output is correct
38 Correct 95 ms 15320 KB Output is correct
39 Correct 1278 ms 148872 KB Output is correct
40 Correct 118 ms 17608 KB Output is correct
41 Correct 100 ms 28116 KB Output is correct
42 Correct 144 ms 21584 KB Output is correct
43 Correct 147 ms 30592 KB Output is correct
44 Correct 667 ms 80316 KB Output is correct
45 Correct 562 ms 88084 KB Output is correct
46 Correct 834 ms 148992 KB Output is correct
47 Correct 1192 ms 149012 KB Output is correct
48 Correct 1493 ms 149924 KB Output is correct
49 Correct 898 ms 227568 KB Output is correct
50 Correct 1043 ms 227896 KB Output is correct
51 Correct 1420 ms 150024 KB Output is correct
52 Correct 1407 ms 149724 KB Output is correct
53 Correct 1646 ms 149860 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 1 ms 328 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 1 ms 328 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 328 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 468 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 328 KB Output is correct
74 Correct 1 ms 212 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 1 ms 324 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 1 ms 212 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 328 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 328 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 212 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 324 KB Output is correct
89 Correct 1 ms 324 KB Output is correct
90 Correct 1 ms 212 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 324 KB Output is correct
95 Correct 1 ms 340 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 212 KB Output is correct
101 Correct 1 ms 324 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 1 ms 340 KB Output is correct
104 Correct 1 ms 336 KB Output is correct
105 Correct 1 ms 332 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 2 ms 468 KB Output is correct
110 Correct 21 ms 4044 KB Output is correct
111 Correct 30 ms 5680 KB Output is correct
112 Correct 27 ms 6228 KB Output is correct
113 Correct 20 ms 6484 KB Output is correct
114 Correct 20 ms 6228 KB Output is correct
115 Correct 18 ms 6296 KB Output is correct
116 Correct 27 ms 6380 KB Output is correct
117 Correct 47 ms 6344 KB Output is correct
118 Correct 42 ms 6336 KB Output is correct
119 Correct 67 ms 12236 KB Output is correct
120 Correct 74 ms 15328 KB Output is correct
121 Correct 54 ms 15752 KB Output is correct
122 Correct 49 ms 15320 KB Output is correct
123 Correct 55 ms 15240 KB Output is correct
124 Correct 246 ms 43680 KB Output is correct
125 Correct 785 ms 127544 KB Output is correct
126 Correct 805 ms 150200 KB Output is correct
127 Correct 696 ms 153452 KB Output is correct
128 Correct 716 ms 150084 KB Output is correct
129 Correct 648 ms 150196 KB Output is correct
130 Correct 991 ms 151088 KB Output is correct
131 Correct 1122 ms 150588 KB Output is correct
132 Correct 36 ms 6228 KB Output is correct
133 Correct 1 ms 468 KB Output is correct
134 Correct 3 ms 852 KB Output is correct
135 Correct 31 ms 4052 KB Output is correct
136 Correct 22 ms 7340 KB Output is correct
137 Correct 29 ms 5708 KB Output is correct
138 Correct 30 ms 6356 KB Output is correct
139 Correct 43 ms 6320 KB Output is correct
140 Correct 46 ms 6316 KB Output is correct
141 Correct 24 ms 6484 KB Output is correct
142 Correct 24 ms 6304 KB Output is correct
143 Correct 16 ms 6228 KB Output is correct
144 Correct 30 ms 9436 KB Output is correct
145 Correct 28 ms 9420 KB Output is correct
146 Correct 36 ms 7840 KB Output is correct
147 Correct 25 ms 6496 KB Output is correct
148 Correct 24 ms 6356 KB Output is correct
149 Correct 30 ms 6416 KB Output is correct
150 Correct 27 ms 6340 KB Output is correct
151 Correct 46 ms 6228 KB Output is correct
152 Correct 43 ms 6252 KB Output is correct
153 Correct 37 ms 6252 KB Output is correct
154 Correct 92 ms 15308 KB Output is correct
155 Correct 38 ms 8008 KB Output is correct
156 Correct 57 ms 12492 KB Output is correct
157 Correct 91 ms 14488 KB Output is correct
158 Correct 77 ms 15324 KB Output is correct
159 Correct 120 ms 15328 KB Output is correct
160 Correct 97 ms 15324 KB Output is correct
161 Correct 57 ms 15960 KB Output is correct
162 Correct 63 ms 15312 KB Output is correct
163 Correct 65 ms 15300 KB Output is correct
164 Correct 72 ms 23024 KB Output is correct
165 Correct 75 ms 23056 KB Output is correct
166 Correct 75 ms 19108 KB Output is correct
167 Correct 88 ms 15608 KB Output is correct
168 Correct 69 ms 15512 KB Output is correct
169 Correct 78 ms 15436 KB Output is correct
170 Correct 80 ms 15404 KB Output is correct
171 Correct 112 ms 15320 KB Output is correct
172 Correct 111 ms 15436 KB Output is correct
173 Correct 92 ms 15300 KB Output is correct
174 Correct 137 ms 20536 KB Output is correct
175 Correct 208 ms 34076 KB Output is correct
176 Correct 490 ms 89488 KB Output is correct
177 Correct 691 ms 102884 KB Output is correct
178 Correct 1018 ms 131932 KB Output is correct
179 Correct 922 ms 150488 KB Output is correct
180 Correct 972 ms 149736 KB Output is correct
181 Correct 1070 ms 149372 KB Output is correct
182 Correct 1312 ms 149196 KB Output is correct
183 Correct 1022 ms 150596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 1 ms 328 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 456 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 38 ms 6316 KB Output is correct
20 Correct 20 ms 7324 KB Output is correct
21 Correct 31 ms 6296 KB Output is correct
22 Correct 40 ms 6332 KB Output is correct
23 Correct 47 ms 6316 KB Output is correct
24 Correct 34 ms 9424 KB Output is correct
25 Correct 27 ms 9312 KB Output is correct
26 Correct 40 ms 6300 KB Output is correct
27 Correct 42 ms 6292 KB Output is correct
28 Correct 35 ms 6220 KB Output is correct
29 Correct 100 ms 15108 KB Output is correct
30 Correct 36 ms 7904 KB Output is correct
31 Correct 69 ms 15212 KB Output is correct
32 Correct 113 ms 15304 KB Output is correct
33 Correct 98 ms 15212 KB Output is correct
34 Correct 76 ms 22964 KB Output is correct
35 Correct 70 ms 22944 KB Output is correct
36 Correct 115 ms 15340 KB Output is correct
37 Correct 116 ms 15244 KB Output is correct
38 Correct 95 ms 15320 KB Output is correct
39 Correct 1278 ms 148872 KB Output is correct
40 Correct 118 ms 17608 KB Output is correct
41 Correct 100 ms 28116 KB Output is correct
42 Correct 144 ms 21584 KB Output is correct
43 Correct 147 ms 30592 KB Output is correct
44 Correct 667 ms 80316 KB Output is correct
45 Correct 562 ms 88084 KB Output is correct
46 Correct 834 ms 148992 KB Output is correct
47 Correct 1192 ms 149012 KB Output is correct
48 Correct 1493 ms 149924 KB Output is correct
49 Correct 898 ms 227568 KB Output is correct
50 Correct 1043 ms 227896 KB Output is correct
51 Correct 1420 ms 150024 KB Output is correct
52 Correct 1407 ms 149724 KB Output is correct
53 Correct 1646 ms 149860 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 1 ms 328 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 1 ms 328 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 328 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 468 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 328 KB Output is correct
74 Correct 1 ms 212 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 1 ms 324 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 1 ms 212 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 328 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 328 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 212 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 324 KB Output is correct
89 Correct 1 ms 324 KB Output is correct
90 Correct 1 ms 212 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 324 KB Output is correct
95 Correct 1 ms 340 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 212 KB Output is correct
101 Correct 1 ms 324 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 1 ms 340 KB Output is correct
104 Correct 1 ms 336 KB Output is correct
105 Correct 1 ms 332 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 2 ms 468 KB Output is correct
110 Correct 21 ms 4044 KB Output is correct
111 Correct 30 ms 5680 KB Output is correct
112 Correct 27 ms 6228 KB Output is correct
113 Correct 20 ms 6484 KB Output is correct
114 Correct 20 ms 6228 KB Output is correct
115 Correct 18 ms 6296 KB Output is correct
116 Correct 27 ms 6380 KB Output is correct
117 Correct 47 ms 6344 KB Output is correct
118 Correct 42 ms 6336 KB Output is correct
119 Correct 67 ms 12236 KB Output is correct
120 Correct 74 ms 15328 KB Output is correct
121 Correct 54 ms 15752 KB Output is correct
122 Correct 49 ms 15320 KB Output is correct
123 Correct 55 ms 15240 KB Output is correct
124 Correct 246 ms 43680 KB Output is correct
125 Correct 785 ms 127544 KB Output is correct
126 Correct 805 ms 150200 KB Output is correct
127 Correct 696 ms 153452 KB Output is correct
128 Correct 716 ms 150084 KB Output is correct
129 Correct 648 ms 150196 KB Output is correct
130 Correct 991 ms 151088 KB Output is correct
131 Correct 1122 ms 150588 KB Output is correct
132 Correct 36 ms 6228 KB Output is correct
133 Correct 1 ms 468 KB Output is correct
134 Correct 3 ms 852 KB Output is correct
135 Correct 31 ms 4052 KB Output is correct
136 Correct 22 ms 7340 KB Output is correct
137 Correct 29 ms 5708 KB Output is correct
138 Correct 30 ms 6356 KB Output is correct
139 Correct 43 ms 6320 KB Output is correct
140 Correct 46 ms 6316 KB Output is correct
141 Correct 24 ms 6484 KB Output is correct
142 Correct 24 ms 6304 KB Output is correct
143 Correct 16 ms 6228 KB Output is correct
144 Correct 30 ms 9436 KB Output is correct
145 Correct 28 ms 9420 KB Output is correct
146 Correct 36 ms 7840 KB Output is correct
147 Correct 25 ms 6496 KB Output is correct
148 Correct 24 ms 6356 KB Output is correct
149 Correct 30 ms 6416 KB Output is correct
150 Correct 27 ms 6340 KB Output is correct
151 Correct 46 ms 6228 KB Output is correct
152 Correct 43 ms 6252 KB Output is correct
153 Correct 37 ms 6252 KB Output is correct
154 Correct 92 ms 15308 KB Output is correct
155 Correct 38 ms 8008 KB Output is correct
156 Correct 57 ms 12492 KB Output is correct
157 Correct 91 ms 14488 KB Output is correct
158 Correct 77 ms 15324 KB Output is correct
159 Correct 120 ms 15328 KB Output is correct
160 Correct 97 ms 15324 KB Output is correct
161 Correct 57 ms 15960 KB Output is correct
162 Correct 63 ms 15312 KB Output is correct
163 Correct 65 ms 15300 KB Output is correct
164 Correct 72 ms 23024 KB Output is correct
165 Correct 75 ms 23056 KB Output is correct
166 Correct 75 ms 19108 KB Output is correct
167 Correct 88 ms 15608 KB Output is correct
168 Correct 69 ms 15512 KB Output is correct
169 Correct 78 ms 15436 KB Output is correct
170 Correct 80 ms 15404 KB Output is correct
171 Correct 112 ms 15320 KB Output is correct
172 Correct 111 ms 15436 KB Output is correct
173 Correct 92 ms 15300 KB Output is correct
174 Correct 137 ms 20536 KB Output is correct
175 Correct 208 ms 34076 KB Output is correct
176 Correct 490 ms 89488 KB Output is correct
177 Correct 691 ms 102884 KB Output is correct
178 Correct 1018 ms 131932 KB Output is correct
179 Correct 922 ms 150488 KB Output is correct
180 Correct 972 ms 149736 KB Output is correct
181 Correct 1070 ms 149372 KB Output is correct
182 Correct 1312 ms 149196 KB Output is correct
183 Correct 1022 ms 150596 KB Output is correct
184 Execution timed out 2095 ms 297416 KB Time limit exceeded
185 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 1 ms 328 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 456 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 38 ms 6316 KB Output is correct
20 Correct 20 ms 7324 KB Output is correct
21 Correct 31 ms 6296 KB Output is correct
22 Correct 40 ms 6332 KB Output is correct
23 Correct 47 ms 6316 KB Output is correct
24 Correct 34 ms 9424 KB Output is correct
25 Correct 27 ms 9312 KB Output is correct
26 Correct 40 ms 6300 KB Output is correct
27 Correct 42 ms 6292 KB Output is correct
28 Correct 35 ms 6220 KB Output is correct
29 Correct 100 ms 15108 KB Output is correct
30 Correct 36 ms 7904 KB Output is correct
31 Correct 69 ms 15212 KB Output is correct
32 Correct 113 ms 15304 KB Output is correct
33 Correct 98 ms 15212 KB Output is correct
34 Correct 76 ms 22964 KB Output is correct
35 Correct 70 ms 22944 KB Output is correct
36 Correct 115 ms 15340 KB Output is correct
37 Correct 116 ms 15244 KB Output is correct
38 Correct 95 ms 15320 KB Output is correct
39 Correct 1278 ms 148872 KB Output is correct
40 Correct 118 ms 17608 KB Output is correct
41 Correct 100 ms 28116 KB Output is correct
42 Correct 144 ms 21584 KB Output is correct
43 Correct 147 ms 30592 KB Output is correct
44 Correct 667 ms 80316 KB Output is correct
45 Correct 562 ms 88084 KB Output is correct
46 Correct 834 ms 148992 KB Output is correct
47 Correct 1192 ms 149012 KB Output is correct
48 Correct 1493 ms 149924 KB Output is correct
49 Correct 898 ms 227568 KB Output is correct
50 Correct 1043 ms 227896 KB Output is correct
51 Correct 1420 ms 150024 KB Output is correct
52 Correct 1407 ms 149724 KB Output is correct
53 Correct 1646 ms 149860 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 1 ms 328 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 1 ms 328 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 328 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 468 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 328 KB Output is correct
74 Correct 1 ms 212 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 1 ms 324 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 1 ms 212 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 328 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 328 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 212 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 324 KB Output is correct
89 Correct 1 ms 324 KB Output is correct
90 Correct 1 ms 212 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 324 KB Output is correct
95 Correct 1 ms 340 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 212 KB Output is correct
101 Correct 1 ms 324 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 1 ms 340 KB Output is correct
104 Correct 1 ms 336 KB Output is correct
105 Correct 1 ms 332 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 2 ms 468 KB Output is correct
110 Correct 21 ms 4044 KB Output is correct
111 Correct 30 ms 5680 KB Output is correct
112 Correct 27 ms 6228 KB Output is correct
113 Correct 20 ms 6484 KB Output is correct
114 Correct 20 ms 6228 KB Output is correct
115 Correct 18 ms 6296 KB Output is correct
116 Correct 27 ms 6380 KB Output is correct
117 Correct 47 ms 6344 KB Output is correct
118 Correct 42 ms 6336 KB Output is correct
119 Correct 67 ms 12236 KB Output is correct
120 Correct 74 ms 15328 KB Output is correct
121 Correct 54 ms 15752 KB Output is correct
122 Correct 49 ms 15320 KB Output is correct
123 Correct 55 ms 15240 KB Output is correct
124 Correct 246 ms 43680 KB Output is correct
125 Correct 785 ms 127544 KB Output is correct
126 Correct 805 ms 150200 KB Output is correct
127 Correct 696 ms 153452 KB Output is correct
128 Correct 716 ms 150084 KB Output is correct
129 Correct 648 ms 150196 KB Output is correct
130 Correct 991 ms 151088 KB Output is correct
131 Correct 1122 ms 150588 KB Output is correct
132 Correct 36 ms 6228 KB Output is correct
133 Correct 1 ms 468 KB Output is correct
134 Correct 3 ms 852 KB Output is correct
135 Correct 31 ms 4052 KB Output is correct
136 Correct 22 ms 7340 KB Output is correct
137 Correct 29 ms 5708 KB Output is correct
138 Correct 30 ms 6356 KB Output is correct
139 Correct 43 ms 6320 KB Output is correct
140 Correct 46 ms 6316 KB Output is correct
141 Correct 24 ms 6484 KB Output is correct
142 Correct 24 ms 6304 KB Output is correct
143 Correct 16 ms 6228 KB Output is correct
144 Correct 30 ms 9436 KB Output is correct
145 Correct 28 ms 9420 KB Output is correct
146 Correct 36 ms 7840 KB Output is correct
147 Correct 25 ms 6496 KB Output is correct
148 Correct 24 ms 6356 KB Output is correct
149 Correct 30 ms 6416 KB Output is correct
150 Correct 27 ms 6340 KB Output is correct
151 Correct 46 ms 6228 KB Output is correct
152 Correct 43 ms 6252 KB Output is correct
153 Correct 37 ms 6252 KB Output is correct
154 Correct 92 ms 15308 KB Output is correct
155 Correct 38 ms 8008 KB Output is correct
156 Correct 57 ms 12492 KB Output is correct
157 Correct 91 ms 14488 KB Output is correct
158 Correct 77 ms 15324 KB Output is correct
159 Correct 120 ms 15328 KB Output is correct
160 Correct 97 ms 15324 KB Output is correct
161 Correct 57 ms 15960 KB Output is correct
162 Correct 63 ms 15312 KB Output is correct
163 Correct 65 ms 15300 KB Output is correct
164 Correct 72 ms 23024 KB Output is correct
165 Correct 75 ms 23056 KB Output is correct
166 Correct 75 ms 19108 KB Output is correct
167 Correct 88 ms 15608 KB Output is correct
168 Correct 69 ms 15512 KB Output is correct
169 Correct 78 ms 15436 KB Output is correct
170 Correct 80 ms 15404 KB Output is correct
171 Correct 112 ms 15320 KB Output is correct
172 Correct 111 ms 15436 KB Output is correct
173 Correct 92 ms 15300 KB Output is correct
174 Correct 137 ms 20536 KB Output is correct
175 Correct 208 ms 34076 KB Output is correct
176 Correct 490 ms 89488 KB Output is correct
177 Correct 691 ms 102884 KB Output is correct
178 Correct 1018 ms 131932 KB Output is correct
179 Correct 922 ms 150488 KB Output is correct
180 Correct 972 ms 149736 KB Output is correct
181 Correct 1070 ms 149372 KB Output is correct
182 Correct 1312 ms 149196 KB Output is correct
183 Correct 1022 ms 150596 KB Output is correct
184 Execution timed out 2095 ms 297416 KB Time limit exceeded
185 Halted 0 ms 0 KB -