답안 #1119002

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1119002 2024-11-26T13:08:33 Z PagodePaiva Toy (CEOI24_toy) C++17
100 / 100
571 ms 244204 KB
#include<bits/stdc++.h>

using namespace std;

const int N = 1510;
const int LOGN = 10;
int n, m;

struct SparseTable{
    int bin[N][LOGN];
    int lg[N];
    void build(vector <int> v){
        lg[1] = 0;
        for(int i = 2;i <= v.size();i++){
            lg[i] = lg[i/2]+1;
        }
        for(int i = 1;i <= v.size();i++){
            bin[i][0] = v[i-1];
        }
        for(int bit = 1;bit < LOGN;bit++){
            for(int i = 1;i <= v.size();i++){
                bin[i][bit] = min(bin[i][bit-1], bin[min((int)v.size(),i+(1<<(bit-1)))][bit-1]);
            }
        }
    }
    int query(int l, int r){
        l++;
        r++;
        int t = (r-l+1);
        return min(bin[l][lg[t]], bin[r-(1<<(lg[t]))+1][lg[t]]);
    }
} linha[N], coluna[N];

int mat[N][N];
int mark[N][N];
int upp[N][N], downn[N][N], leftt[N][N], rightt[N][N];

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    int k , l;
    cin >> m >> n >> k >> l;
    int stx, sty, bunda;
    int edx, edy;
    cin >> bunda >> sty >> stx >> bunda;
    for(int i = 0;i < n;i++){
        for(int j = 0;j < m;j++){
            char c;
            cin >> c;
            if(c == '.') mat[i][j] = 0;
            if(c == 'X') mat[i][j] = 1;
            if(c == '*'){
                edx = i;
                edy = j;
                mat[i][j] = 0;
            }
        }
    }
    for(int i = 0;i < n;i++){
        int sum = 0;
        vector <int> vv;
        for(int j = 0;j < k;j++){
            sum += mat[i][j];
            vv.push_back(mat[i][j]);
        }
        vector <int> v;
        v.push_back(sum);
        for(int j = k;j < m;j++){
            sum -= mat[i][j-k];
            sum += mat[i][j];
            v.push_back(sum);
            vv.push_back(mat[i][j]);
        }
        linha[i].build(v);
        /*for(auto x : vv){
            cout << x;
        }
        cout << '\n';*/
    }
    for(int j = 0;j < m;j++){
        int sum = 0;
        vector <int> vv;
        for(int i = 0;i < l;i++){
            sum += mat[i][j];
            vv.push_back(mat[i][j]);
        }
        vector <int> v;
        v.push_back(sum);
        for(int i = l;i < n;i++){
            sum -= mat[i-l][j];
            sum += mat[i][j];
            v.push_back(sum);
            vv.push_back(mat[i][j]);
        }
        coluna[j].build(v);
      //for(auto x : v){
        //    cout << x;
        //}
        //cout << '\n';
    }
   /* for(int i = 0;i < n;i++){
        for(int j = 0;j < m;j++){
            cout << linhatrue[i].query(j, j);
        }
        cout << '\n';
    }*/
    for(int x = 0;x < n;x++){
        int at = 0;
        for(int y = 0;y < m;y++){
            if(mat[x][y] == 1) at = y;
            leftt[y][x] = max(at, y-k+1);
        }
        at = m-1;
        for(int y = m-1;y >= 0;y--){
            if(mat[x][y] == 1) at = y;
            rightt[y][x] = min(at, y+k-1);
        }
    }
    for(int y = 0;y < m;y++){
        int at = 0;
        for(int x = 0;x < n;x++){
            if(mat[x][y] == 1) at = x;
            upp[y][x] = max(at, x-l+1);
        }
        at = n-1;
        for(int x = n-1;x >= 0;x--){
            if(mat[x][y] == 1) at = x;
            downn[y][x] = min(at, x+l-1);
        }
    }
    queue <pair <int, int>> q;
    q.push({stx, sty});
    while(!q.empty()){
        auto [x, y] = q.front();
        q.pop();
        if(mark[x][y] == 1) continue;
        //cout << x << ' ' << y << '\n';
        mark[x][y] = 1; 
        int up = upp[x][y];
        int down = downn[x][y];
        int left = leftt[x][y];
        int right = rightt[x][y];
        //cout << right << ' ';
        //cout << x << ' ' << k << ' ' << right << '\n';
        // (x-1, y)
        //cout << up << ' ' << down << ' ' << left << ' ' << right << '\n';
        //cout << "(" << x << "," << y << ") vai para:";
        if(y > 0){
            if(linha[y-1].query(left, right-k+1) == 0){
               // cout << "(" << x << "," << y-1 << ") ";
                q.push({x, y-1});
            }
        }
        // (x+1, y)
        if(y<n-1){
            if(linha[y+1].query(left, right-k+1) == 0){
               // cout << "(" << x << "," << y+1 << ") ";
                q.push({x, y+1});
            }
        }
        //
        if(x > 0){
            if(coluna[x-1].query(up, down-l+1) == 0){
              //  cout << "(" << x-1 << "," << y << ") ";
                q.push({x-1, y});
            }
        }
        //
        if(x < m-1){
            //if(x == 1 and y == 0) cout << 'a' << coluna[y+1].query(0, 0) << ' ' << coluna[y+1].query(1, 1) << '\n';
            if(coluna[x+1].query(up, down-l+1) == 0){
               // cout << "(" << x+1 << "," << y << ") ";
                q.push({x+1, y});
            }
        }
        //cout << '\n';
    }
    /*for(int i = 0;i < n;i++){
        for(int j = 0;j < m;j++){
            cout << mark[i][j] << ' ';
        }
        cout << '\n';
    }*/
    if(mark[edy][edx] == 1){
        cout << "YES\n";
    }
    else{
        cout << "NO\n";
    }
    return 0;
}

Compilation message

Main.cpp: In member function 'void SparseTable::build(std::vector<int>)':
Main.cpp:14:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |         for(int i = 2;i <= v.size();i++){
      |                       ~~^~~~~~~~~~~
Main.cpp:17:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         for(int i = 1;i <= v.size();i++){
      |                       ~~^~~~~~~~~~~
Main.cpp:21:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |             for(int i = 1;i <= v.size();i++){
      |                           ~~^~~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:183:21: warning: 'edy' may be used uninitialized in this function [-Wmaybe-uninitialized]
  183 |     if(mark[edy][edx] == 1){
      |        ~~~~~~~~~~~~~^
Main.cpp:183:21: warning: 'edx' may be used uninitialized in this function [-Wmaybe-uninitialized]
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 1616 KB Output is correct
4 Correct 2 ms 2640 KB Output is correct
5 Correct 3 ms 2384 KB Output is correct
6 Correct 1 ms 1104 KB Output is correct
7 Correct 2 ms 2384 KB Output is correct
8 Correct 2 ms 2384 KB Output is correct
9 Correct 2 ms 1360 KB Output is correct
10 Correct 2 ms 2384 KB Output is correct
11 Correct 2 ms 2128 KB Output is correct
12 Correct 1 ms 592 KB Output is correct
13 Correct 3 ms 2384 KB Output is correct
14 Correct 3 ms 2128 KB Output is correct
15 Correct 3 ms 2384 KB Output is correct
16 Correct 2 ms 2384 KB Output is correct
17 Correct 3 ms 2384 KB Output is correct
18 Correct 2 ms 2640 KB Output is correct
19 Correct 3 ms 2640 KB Output is correct
20 Correct 2 ms 2640 KB Output is correct
21 Correct 2 ms 2640 KB Output is correct
22 Correct 3 ms 2616 KB Output is correct
23 Correct 2 ms 2640 KB Output is correct
24 Correct 3 ms 2640 KB Output is correct
25 Correct 3 ms 2640 KB Output is correct
26 Correct 2 ms 2640 KB Output is correct
27 Correct 3 ms 2640 KB Output is correct
28 Correct 4 ms 2640 KB Output is correct
29 Correct 3 ms 2640 KB Output is correct
30 Correct 3 ms 2640 KB Output is correct
31 Correct 2 ms 2384 KB Output is correct
32 Correct 2 ms 2640 KB Output is correct
33 Correct 3 ms 2596 KB Output is correct
34 Correct 2 ms 2384 KB Output is correct
35 Correct 3 ms 2568 KB Output is correct
36 Correct 2 ms 2384 KB Output is correct
37 Correct 2 ms 2384 KB Output is correct
38 Correct 2 ms 2248 KB Output is correct
39 Correct 2 ms 2384 KB Output is correct
40 Correct 2 ms 2384 KB Output is correct
41 Correct 2 ms 2384 KB Output is correct
42 Correct 2 ms 2384 KB Output is correct
43 Correct 2 ms 2384 KB Output is correct
44 Correct 2 ms 2384 KB Output is correct
45 Correct 2 ms 2556 KB Output is correct
46 Correct 2 ms 2384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 1616 KB Output is correct
4 Correct 2 ms 2640 KB Output is correct
5 Correct 3 ms 2384 KB Output is correct
6 Correct 1 ms 1104 KB Output is correct
7 Correct 2 ms 2384 KB Output is correct
8 Correct 2 ms 2384 KB Output is correct
9 Correct 2 ms 1360 KB Output is correct
10 Correct 2 ms 2384 KB Output is correct
11 Correct 2 ms 2128 KB Output is correct
12 Correct 1 ms 592 KB Output is correct
13 Correct 3 ms 2384 KB Output is correct
14 Correct 3 ms 2128 KB Output is correct
15 Correct 3 ms 2384 KB Output is correct
16 Correct 2 ms 2384 KB Output is correct
17 Correct 3 ms 2384 KB Output is correct
18 Correct 2 ms 2640 KB Output is correct
19 Correct 3 ms 2640 KB Output is correct
20 Correct 2 ms 2640 KB Output is correct
21 Correct 2 ms 2640 KB Output is correct
22 Correct 3 ms 2616 KB Output is correct
23 Correct 2 ms 2640 KB Output is correct
24 Correct 3 ms 2640 KB Output is correct
25 Correct 3 ms 2640 KB Output is correct
26 Correct 2 ms 2640 KB Output is correct
27 Correct 3 ms 2640 KB Output is correct
28 Correct 4 ms 2640 KB Output is correct
29 Correct 3 ms 2640 KB Output is correct
30 Correct 3 ms 2640 KB Output is correct
31 Correct 2 ms 2384 KB Output is correct
32 Correct 2 ms 2640 KB Output is correct
33 Correct 3 ms 2596 KB Output is correct
34 Correct 2 ms 2384 KB Output is correct
35 Correct 3 ms 2568 KB Output is correct
36 Correct 2 ms 2384 KB Output is correct
37 Correct 2 ms 2384 KB Output is correct
38 Correct 2 ms 2248 KB Output is correct
39 Correct 2 ms 2384 KB Output is correct
40 Correct 2 ms 2384 KB Output is correct
41 Correct 2 ms 2384 KB Output is correct
42 Correct 2 ms 2384 KB Output is correct
43 Correct 2 ms 2384 KB Output is correct
44 Correct 2 ms 2384 KB Output is correct
45 Correct 2 ms 2556 KB Output is correct
46 Correct 2 ms 2384 KB Output is correct
47 Correct 3 ms 2640 KB Output is correct
48 Correct 3 ms 4176 KB Output is correct
49 Correct 4 ms 3920 KB Output is correct
50 Correct 4 ms 3408 KB Output is correct
51 Correct 6 ms 4432 KB Output is correct
52 Correct 3 ms 4144 KB Output is correct
53 Correct 4 ms 3416 KB Output is correct
54 Correct 4 ms 4176 KB Output is correct
55 Correct 4 ms 3932 KB Output is correct
56 Correct 3 ms 2384 KB Output is correct
57 Correct 4 ms 3920 KB Output is correct
58 Correct 4 ms 3920 KB Output is correct
59 Correct 5 ms 4432 KB Output is correct
60 Correct 5 ms 4344 KB Output is correct
61 Correct 5 ms 4600 KB Output is correct
62 Correct 4 ms 4688 KB Output is correct
63 Correct 6 ms 4688 KB Output is correct
64 Correct 6 ms 4688 KB Output is correct
65 Correct 5 ms 4688 KB Output is correct
66 Correct 6 ms 4704 KB Output is correct
67 Correct 5 ms 4688 KB Output is correct
68 Correct 4 ms 4832 KB Output is correct
69 Correct 5 ms 4688 KB Output is correct
70 Correct 5 ms 4700 KB Output is correct
71 Correct 4 ms 4688 KB Output is correct
72 Correct 5 ms 4688 KB Output is correct
73 Correct 5 ms 4688 KB Output is correct
74 Correct 4 ms 4432 KB Output is correct
75 Correct 6 ms 4688 KB Output is correct
76 Correct 5 ms 4944 KB Output is correct
77 Correct 5 ms 4568 KB Output is correct
78 Correct 6 ms 4688 KB Output is correct
79 Correct 4 ms 4432 KB Output is correct
80 Correct 4 ms 4436 KB Output is correct
81 Correct 4 ms 4312 KB Output is correct
82 Correct 5 ms 4312 KB Output is correct
83 Correct 4 ms 4176 KB Output is correct
84 Correct 4 ms 4432 KB Output is correct
85 Correct 5 ms 4176 KB Output is correct
86 Correct 6 ms 4176 KB Output is correct
87 Correct 5 ms 4320 KB Output is correct
88 Correct 4 ms 4176 KB Output is correct
89 Correct 4 ms 4176 KB Output is correct
90 Correct 4 ms 4432 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 4 ms 3920 KB Output is correct
4 Correct 33 ms 22192 KB Output is correct
5 Correct 33 ms 22172 KB Output is correct
6 Correct 6 ms 6736 KB Output is correct
7 Correct 28 ms 22096 KB Output is correct
8 Correct 35 ms 22096 KB Output is correct
9 Correct 11 ms 11600 KB Output is correct
10 Correct 19 ms 20816 KB Output is correct
11 Correct 19 ms 20644 KB Output is correct
12 Correct 9 ms 9296 KB Output is correct
13 Correct 20 ms 20816 KB Output is correct
14 Correct 20 ms 20624 KB Output is correct
15 Correct 26 ms 21088 KB Output is correct
16 Correct 27 ms 20552 KB Output is correct
17 Correct 31 ms 20304 KB Output is correct
18 Correct 29 ms 22096 KB Output is correct
19 Correct 24 ms 22096 KB Output is correct
20 Correct 28 ms 22188 KB Output is correct
21 Correct 28 ms 22096 KB Output is correct
22 Correct 28 ms 22096 KB Output is correct
23 Correct 31 ms 22100 KB Output is correct
24 Correct 24 ms 22096 KB Output is correct
25 Correct 26 ms 22096 KB Output is correct
26 Correct 30 ms 22168 KB Output is correct
27 Correct 33 ms 22236 KB Output is correct
28 Correct 29 ms 22100 KB Output is correct
29 Correct 29 ms 22140 KB Output is correct
30 Correct 26 ms 21832 KB Output is correct
31 Correct 24 ms 21072 KB Output is correct
32 Correct 24 ms 21840 KB Output is correct
33 Correct 23 ms 20816 KB Output is correct
34 Correct 25 ms 20748 KB Output is correct
35 Correct 27 ms 20824 KB Output is correct
36 Correct 21 ms 20304 KB Output is correct
37 Correct 22 ms 20816 KB Output is correct
38 Correct 21 ms 19536 KB Output is correct
39 Correct 21 ms 20048 KB Output is correct
40 Correct 23 ms 20804 KB Output is correct
41 Correct 22 ms 19536 KB Output is correct
42 Correct 33 ms 22044 KB Output is correct
43 Correct 34 ms 22108 KB Output is correct
44 Correct 30 ms 22096 KB Output is correct
45 Correct 32 ms 22136 KB Output is correct
46 Correct 22 ms 19536 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 1616 KB Output is correct
4 Correct 2 ms 2640 KB Output is correct
5 Correct 3 ms 2384 KB Output is correct
6 Correct 1 ms 1104 KB Output is correct
7 Correct 2 ms 2384 KB Output is correct
8 Correct 2 ms 2384 KB Output is correct
9 Correct 2 ms 1360 KB Output is correct
10 Correct 2 ms 2384 KB Output is correct
11 Correct 2 ms 2128 KB Output is correct
12 Correct 1 ms 592 KB Output is correct
13 Correct 3 ms 2384 KB Output is correct
14 Correct 3 ms 2128 KB Output is correct
15 Correct 3 ms 2384 KB Output is correct
16 Correct 2 ms 2384 KB Output is correct
17 Correct 3 ms 2384 KB Output is correct
18 Correct 2 ms 2640 KB Output is correct
19 Correct 3 ms 2640 KB Output is correct
20 Correct 2 ms 2640 KB Output is correct
21 Correct 2 ms 2640 KB Output is correct
22 Correct 3 ms 2616 KB Output is correct
23 Correct 2 ms 2640 KB Output is correct
24 Correct 3 ms 2640 KB Output is correct
25 Correct 3 ms 2640 KB Output is correct
26 Correct 2 ms 2640 KB Output is correct
27 Correct 3 ms 2640 KB Output is correct
28 Correct 4 ms 2640 KB Output is correct
29 Correct 3 ms 2640 KB Output is correct
30 Correct 3 ms 2640 KB Output is correct
31 Correct 2 ms 2384 KB Output is correct
32 Correct 2 ms 2640 KB Output is correct
33 Correct 3 ms 2596 KB Output is correct
34 Correct 2 ms 2384 KB Output is correct
35 Correct 3 ms 2568 KB Output is correct
36 Correct 2 ms 2384 KB Output is correct
37 Correct 2 ms 2384 KB Output is correct
38 Correct 2 ms 2248 KB Output is correct
39 Correct 2 ms 2384 KB Output is correct
40 Correct 2 ms 2384 KB Output is correct
41 Correct 2 ms 2384 KB Output is correct
42 Correct 2 ms 2384 KB Output is correct
43 Correct 2 ms 2384 KB Output is correct
44 Correct 2 ms 2384 KB Output is correct
45 Correct 2 ms 2556 KB Output is correct
46 Correct 2 ms 2384 KB Output is correct
47 Correct 3 ms 2640 KB Output is correct
48 Correct 3 ms 4176 KB Output is correct
49 Correct 4 ms 3920 KB Output is correct
50 Correct 4 ms 3408 KB Output is correct
51 Correct 6 ms 4432 KB Output is correct
52 Correct 3 ms 4144 KB Output is correct
53 Correct 4 ms 3416 KB Output is correct
54 Correct 4 ms 4176 KB Output is correct
55 Correct 4 ms 3932 KB Output is correct
56 Correct 3 ms 2384 KB Output is correct
57 Correct 4 ms 3920 KB Output is correct
58 Correct 4 ms 3920 KB Output is correct
59 Correct 5 ms 4432 KB Output is correct
60 Correct 5 ms 4344 KB Output is correct
61 Correct 5 ms 4600 KB Output is correct
62 Correct 4 ms 4688 KB Output is correct
63 Correct 6 ms 4688 KB Output is correct
64 Correct 6 ms 4688 KB Output is correct
65 Correct 5 ms 4688 KB Output is correct
66 Correct 6 ms 4704 KB Output is correct
67 Correct 5 ms 4688 KB Output is correct
68 Correct 4 ms 4832 KB Output is correct
69 Correct 5 ms 4688 KB Output is correct
70 Correct 5 ms 4700 KB Output is correct
71 Correct 4 ms 4688 KB Output is correct
72 Correct 5 ms 4688 KB Output is correct
73 Correct 5 ms 4688 KB Output is correct
74 Correct 4 ms 4432 KB Output is correct
75 Correct 6 ms 4688 KB Output is correct
76 Correct 5 ms 4944 KB Output is correct
77 Correct 5 ms 4568 KB Output is correct
78 Correct 6 ms 4688 KB Output is correct
79 Correct 4 ms 4432 KB Output is correct
80 Correct 4 ms 4436 KB Output is correct
81 Correct 4 ms 4312 KB Output is correct
82 Correct 5 ms 4312 KB Output is correct
83 Correct 4 ms 4176 KB Output is correct
84 Correct 4 ms 4432 KB Output is correct
85 Correct 5 ms 4176 KB Output is correct
86 Correct 6 ms 4176 KB Output is correct
87 Correct 5 ms 4320 KB Output is correct
88 Correct 4 ms 4176 KB Output is correct
89 Correct 4 ms 4176 KB Output is correct
90 Correct 4 ms 4432 KB Output is correct
91 Correct 4 ms 3920 KB Output is correct
92 Correct 33 ms 22192 KB Output is correct
93 Correct 33 ms 22172 KB Output is correct
94 Correct 6 ms 6736 KB Output is correct
95 Correct 28 ms 22096 KB Output is correct
96 Correct 35 ms 22096 KB Output is correct
97 Correct 11 ms 11600 KB Output is correct
98 Correct 19 ms 20816 KB Output is correct
99 Correct 19 ms 20644 KB Output is correct
100 Correct 9 ms 9296 KB Output is correct
101 Correct 20 ms 20816 KB Output is correct
102 Correct 20 ms 20624 KB Output is correct
103 Correct 26 ms 21088 KB Output is correct
104 Correct 27 ms 20552 KB Output is correct
105 Correct 31 ms 20304 KB Output is correct
106 Correct 29 ms 22096 KB Output is correct
107 Correct 24 ms 22096 KB Output is correct
108 Correct 28 ms 22188 KB Output is correct
109 Correct 28 ms 22096 KB Output is correct
110 Correct 28 ms 22096 KB Output is correct
111 Correct 31 ms 22100 KB Output is correct
112 Correct 24 ms 22096 KB Output is correct
113 Correct 26 ms 22096 KB Output is correct
114 Correct 30 ms 22168 KB Output is correct
115 Correct 33 ms 22236 KB Output is correct
116 Correct 29 ms 22100 KB Output is correct
117 Correct 29 ms 22140 KB Output is correct
118 Correct 26 ms 21832 KB Output is correct
119 Correct 24 ms 21072 KB Output is correct
120 Correct 24 ms 21840 KB Output is correct
121 Correct 23 ms 20816 KB Output is correct
122 Correct 25 ms 20748 KB Output is correct
123 Correct 27 ms 20824 KB Output is correct
124 Correct 21 ms 20304 KB Output is correct
125 Correct 22 ms 20816 KB Output is correct
126 Correct 21 ms 19536 KB Output is correct
127 Correct 21 ms 20048 KB Output is correct
128 Correct 23 ms 20804 KB Output is correct
129 Correct 22 ms 19536 KB Output is correct
130 Correct 33 ms 22044 KB Output is correct
131 Correct 34 ms 22108 KB Output is correct
132 Correct 30 ms 22096 KB Output is correct
133 Correct 32 ms 22136 KB Output is correct
134 Correct 22 ms 19536 KB Output is correct
135 Correct 8 ms 9552 KB Output is correct
136 Correct 25 ms 22608 KB Output is correct
137 Correct 16 ms 16044 KB Output is correct
138 Correct 11 ms 12624 KB Output is correct
139 Correct 23 ms 23376 KB Output is correct
140 Correct 14 ms 16208 KB Output is correct
141 Correct 11 ms 10572 KB Output is correct
142 Correct 25 ms 22144 KB Output is correct
143 Correct 14 ms 16208 KB Output is correct
144 Correct 4 ms 4944 KB Output is correct
145 Correct 20 ms 19028 KB Output is correct
146 Correct 18 ms 16208 KB Output is correct
147 Correct 34 ms 22088 KB Output is correct
148 Correct 36 ms 22808 KB Output is correct
149 Correct 40 ms 21840 KB Output is correct
150 Correct 31 ms 23632 KB Output is correct
151 Correct 32 ms 23588 KB Output is correct
152 Correct 27 ms 23632 KB Output is correct
153 Correct 30 ms 23624 KB Output is correct
154 Correct 33 ms 23724 KB Output is correct
155 Correct 36 ms 23632 KB Output is correct
156 Correct 34 ms 26284 KB Output is correct
157 Correct 29 ms 26448 KB Output is correct
158 Correct 33 ms 26448 KB Output is correct
159 Correct 42 ms 26536 KB Output is correct
160 Correct 37 ms 26436 KB Output is correct
161 Correct 36 ms 26440 KB Output is correct
162 Correct 39 ms 27356 KB Output is correct
163 Correct 34 ms 26888 KB Output is correct
164 Correct 32 ms 28240 KB Output is correct
165 Correct 35 ms 26440 KB Output is correct
166 Correct 40 ms 27884 KB Output is correct
167 Correct 31 ms 27208 KB Output is correct
168 Correct 25 ms 24728 KB Output is correct
169 Correct 25 ms 24140 KB Output is correct
170 Correct 30 ms 24400 KB Output is correct
171 Correct 30 ms 23888 KB Output is correct
172 Correct 26 ms 22608 KB Output is correct
173 Correct 25 ms 24156 KB Output is correct
174 Correct 32 ms 18000 KB Output is correct
175 Correct 27 ms 18176 KB Output is correct
176 Correct 22 ms 18000 KB Output is correct
177 Correct 26 ms 18212 KB Output is correct
178 Correct 28 ms 22608 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 1616 KB Output is correct
4 Correct 2 ms 2640 KB Output is correct
5 Correct 3 ms 2384 KB Output is correct
6 Correct 1 ms 1104 KB Output is correct
7 Correct 2 ms 2384 KB Output is correct
8 Correct 2 ms 2384 KB Output is correct
9 Correct 2 ms 1360 KB Output is correct
10 Correct 2 ms 2384 KB Output is correct
11 Correct 2 ms 2128 KB Output is correct
12 Correct 1 ms 592 KB Output is correct
13 Correct 3 ms 2384 KB Output is correct
14 Correct 3 ms 2128 KB Output is correct
15 Correct 3 ms 2384 KB Output is correct
16 Correct 2 ms 2384 KB Output is correct
17 Correct 3 ms 2384 KB Output is correct
18 Correct 2 ms 2640 KB Output is correct
19 Correct 3 ms 2640 KB Output is correct
20 Correct 2 ms 2640 KB Output is correct
21 Correct 2 ms 2640 KB Output is correct
22 Correct 3 ms 2616 KB Output is correct
23 Correct 2 ms 2640 KB Output is correct
24 Correct 3 ms 2640 KB Output is correct
25 Correct 3 ms 2640 KB Output is correct
26 Correct 2 ms 2640 KB Output is correct
27 Correct 3 ms 2640 KB Output is correct
28 Correct 4 ms 2640 KB Output is correct
29 Correct 3 ms 2640 KB Output is correct
30 Correct 3 ms 2640 KB Output is correct
31 Correct 2 ms 2384 KB Output is correct
32 Correct 2 ms 2640 KB Output is correct
33 Correct 3 ms 2596 KB Output is correct
34 Correct 2 ms 2384 KB Output is correct
35 Correct 3 ms 2568 KB Output is correct
36 Correct 2 ms 2384 KB Output is correct
37 Correct 2 ms 2384 KB Output is correct
38 Correct 2 ms 2248 KB Output is correct
39 Correct 2 ms 2384 KB Output is correct
40 Correct 2 ms 2384 KB Output is correct
41 Correct 2 ms 2384 KB Output is correct
42 Correct 2 ms 2384 KB Output is correct
43 Correct 2 ms 2384 KB Output is correct
44 Correct 2 ms 2384 KB Output is correct
45 Correct 2 ms 2556 KB Output is correct
46 Correct 2 ms 2384 KB Output is correct
47 Correct 3 ms 2640 KB Output is correct
48 Correct 3 ms 4176 KB Output is correct
49 Correct 4 ms 3920 KB Output is correct
50 Correct 4 ms 3408 KB Output is correct
51 Correct 6 ms 4432 KB Output is correct
52 Correct 3 ms 4144 KB Output is correct
53 Correct 4 ms 3416 KB Output is correct
54 Correct 4 ms 4176 KB Output is correct
55 Correct 4 ms 3932 KB Output is correct
56 Correct 3 ms 2384 KB Output is correct
57 Correct 4 ms 3920 KB Output is correct
58 Correct 4 ms 3920 KB Output is correct
59 Correct 5 ms 4432 KB Output is correct
60 Correct 5 ms 4344 KB Output is correct
61 Correct 5 ms 4600 KB Output is correct
62 Correct 4 ms 4688 KB Output is correct
63 Correct 6 ms 4688 KB Output is correct
64 Correct 6 ms 4688 KB Output is correct
65 Correct 5 ms 4688 KB Output is correct
66 Correct 6 ms 4704 KB Output is correct
67 Correct 5 ms 4688 KB Output is correct
68 Correct 4 ms 4832 KB Output is correct
69 Correct 5 ms 4688 KB Output is correct
70 Correct 5 ms 4700 KB Output is correct
71 Correct 4 ms 4688 KB Output is correct
72 Correct 5 ms 4688 KB Output is correct
73 Correct 5 ms 4688 KB Output is correct
74 Correct 4 ms 4432 KB Output is correct
75 Correct 6 ms 4688 KB Output is correct
76 Correct 5 ms 4944 KB Output is correct
77 Correct 5 ms 4568 KB Output is correct
78 Correct 6 ms 4688 KB Output is correct
79 Correct 4 ms 4432 KB Output is correct
80 Correct 4 ms 4436 KB Output is correct
81 Correct 4 ms 4312 KB Output is correct
82 Correct 5 ms 4312 KB Output is correct
83 Correct 4 ms 4176 KB Output is correct
84 Correct 4 ms 4432 KB Output is correct
85 Correct 5 ms 4176 KB Output is correct
86 Correct 6 ms 4176 KB Output is correct
87 Correct 5 ms 4320 KB Output is correct
88 Correct 4 ms 4176 KB Output is correct
89 Correct 4 ms 4176 KB Output is correct
90 Correct 4 ms 4432 KB Output is correct
91 Correct 4 ms 3920 KB Output is correct
92 Correct 33 ms 22192 KB Output is correct
93 Correct 33 ms 22172 KB Output is correct
94 Correct 6 ms 6736 KB Output is correct
95 Correct 28 ms 22096 KB Output is correct
96 Correct 35 ms 22096 KB Output is correct
97 Correct 11 ms 11600 KB Output is correct
98 Correct 19 ms 20816 KB Output is correct
99 Correct 19 ms 20644 KB Output is correct
100 Correct 9 ms 9296 KB Output is correct
101 Correct 20 ms 20816 KB Output is correct
102 Correct 20 ms 20624 KB Output is correct
103 Correct 26 ms 21088 KB Output is correct
104 Correct 27 ms 20552 KB Output is correct
105 Correct 31 ms 20304 KB Output is correct
106 Correct 29 ms 22096 KB Output is correct
107 Correct 24 ms 22096 KB Output is correct
108 Correct 28 ms 22188 KB Output is correct
109 Correct 28 ms 22096 KB Output is correct
110 Correct 28 ms 22096 KB Output is correct
111 Correct 31 ms 22100 KB Output is correct
112 Correct 24 ms 22096 KB Output is correct
113 Correct 26 ms 22096 KB Output is correct
114 Correct 30 ms 22168 KB Output is correct
115 Correct 33 ms 22236 KB Output is correct
116 Correct 29 ms 22100 KB Output is correct
117 Correct 29 ms 22140 KB Output is correct
118 Correct 26 ms 21832 KB Output is correct
119 Correct 24 ms 21072 KB Output is correct
120 Correct 24 ms 21840 KB Output is correct
121 Correct 23 ms 20816 KB Output is correct
122 Correct 25 ms 20748 KB Output is correct
123 Correct 27 ms 20824 KB Output is correct
124 Correct 21 ms 20304 KB Output is correct
125 Correct 22 ms 20816 KB Output is correct
126 Correct 21 ms 19536 KB Output is correct
127 Correct 21 ms 20048 KB Output is correct
128 Correct 23 ms 20804 KB Output is correct
129 Correct 22 ms 19536 KB Output is correct
130 Correct 33 ms 22044 KB Output is correct
131 Correct 34 ms 22108 KB Output is correct
132 Correct 30 ms 22096 KB Output is correct
133 Correct 32 ms 22136 KB Output is correct
134 Correct 22 ms 19536 KB Output is correct
135 Correct 8 ms 9552 KB Output is correct
136 Correct 25 ms 22608 KB Output is correct
137 Correct 16 ms 16044 KB Output is correct
138 Correct 11 ms 12624 KB Output is correct
139 Correct 23 ms 23376 KB Output is correct
140 Correct 14 ms 16208 KB Output is correct
141 Correct 11 ms 10572 KB Output is correct
142 Correct 25 ms 22144 KB Output is correct
143 Correct 14 ms 16208 KB Output is correct
144 Correct 4 ms 4944 KB Output is correct
145 Correct 20 ms 19028 KB Output is correct
146 Correct 18 ms 16208 KB Output is correct
147 Correct 34 ms 22088 KB Output is correct
148 Correct 36 ms 22808 KB Output is correct
149 Correct 40 ms 21840 KB Output is correct
150 Correct 31 ms 23632 KB Output is correct
151 Correct 32 ms 23588 KB Output is correct
152 Correct 27 ms 23632 KB Output is correct
153 Correct 30 ms 23624 KB Output is correct
154 Correct 33 ms 23724 KB Output is correct
155 Correct 36 ms 23632 KB Output is correct
156 Correct 34 ms 26284 KB Output is correct
157 Correct 29 ms 26448 KB Output is correct
158 Correct 33 ms 26448 KB Output is correct
159 Correct 42 ms 26536 KB Output is correct
160 Correct 37 ms 26436 KB Output is correct
161 Correct 36 ms 26440 KB Output is correct
162 Correct 39 ms 27356 KB Output is correct
163 Correct 34 ms 26888 KB Output is correct
164 Correct 32 ms 28240 KB Output is correct
165 Correct 35 ms 26440 KB Output is correct
166 Correct 40 ms 27884 KB Output is correct
167 Correct 31 ms 27208 KB Output is correct
168 Correct 25 ms 24728 KB Output is correct
169 Correct 25 ms 24140 KB Output is correct
170 Correct 30 ms 24400 KB Output is correct
171 Correct 30 ms 23888 KB Output is correct
172 Correct 26 ms 22608 KB Output is correct
173 Correct 25 ms 24156 KB Output is correct
174 Correct 32 ms 18000 KB Output is correct
175 Correct 27 ms 18176 KB Output is correct
176 Correct 22 ms 18000 KB Output is correct
177 Correct 26 ms 18212 KB Output is correct
178 Correct 28 ms 22608 KB Output is correct
179 Correct 75 ms 71900 KB Output is correct
180 Correct 228 ms 166428 KB Output is correct
181 Correct 107 ms 71360 KB Output is correct
182 Correct 50 ms 42312 KB Output is correct
183 Correct 272 ms 204416 KB Output is correct
184 Correct 105 ms 71344 KB Output is correct
185 Correct 191 ms 141144 KB Output is correct
186 Correct 168 ms 140616 KB Output is correct
187 Correct 95 ms 71280 KB Output is correct
188 Correct 132 ms 109400 KB Output is correct
189 Correct 282 ms 239432 KB Output is correct
190 Correct 134 ms 71296 KB Output is correct
191 Correct 469 ms 155464 KB Output is correct
192 Correct 525 ms 168280 KB Output is correct
193 Correct 495 ms 159552 KB Output is correct
194 Correct 406 ms 173904 KB Output is correct
195 Correct 380 ms 174072 KB Output is correct
196 Correct 394 ms 174192 KB Output is correct
197 Correct 380 ms 173900 KB Output is correct
198 Correct 437 ms 174176 KB Output is correct
199 Correct 423 ms 174280 KB Output is correct
200 Correct 472 ms 217932 KB Output is correct
201 Correct 500 ms 217976 KB Output is correct
202 Correct 550 ms 218012 KB Output is correct
203 Correct 552 ms 217980 KB Output is correct
204 Correct 543 ms 218248 KB Output is correct
205 Correct 571 ms 218304 KB Output is correct
206 Correct 439 ms 230580 KB Output is correct
207 Correct 458 ms 234316 KB Output is correct
208 Correct 444 ms 224652 KB Output is correct
209 Correct 416 ms 234716 KB Output is correct
210 Correct 440 ms 236792 KB Output is correct
211 Correct 478 ms 244204 KB Output is correct
212 Correct 257 ms 193100 KB Output is correct
213 Correct 312 ms 199636 KB Output is correct
214 Correct 283 ms 189884 KB Output is correct
215 Correct 316 ms 202060 KB Output is correct
216 Correct 271 ms 186956 KB Output is correct
217 Correct 269 ms 189516 KB Output is correct
218 Correct 356 ms 80204 KB Output is correct
219 Correct 304 ms 80292 KB Output is correct
220 Correct 325 ms 80376 KB Output is correct
221 Correct 269 ms 80208 KB Output is correct
222 Correct 211 ms 181028 KB Output is correct