Submission #1039586

# Submission time Handle Problem Language Result Execution time Memory
1039586 2024-07-31T04:58:27 Z 정지훈(#11027) Toy (CEOI24_toy) C++17
100 / 100
197 ms 71764 KB
#include <bits/stdc++.h>
using namespace std;

int m,n;
int k; //����
int l; //����
char s[1501][1501];
int arr[1500][1500];
vector<int> vx[1501];
vector<int> vy[1501];
typedef pair<int,int> P;
P xg[1501][1501];
P yg[1501][1501];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int p[3000000];

int find(int a) {
    return p[a]<0?a:p[a]=find(p[a]);
}

void merge(int a,int b) {
    a=find(a);
    b=find(b);
    if (a!=b) {
        p[b]=a;
    }
}

bool func(int x,int y) {
    if (yg[x][y].second-yg[x][y].first<=k) {
        return false;
    }
    if (xg[x][y].second-xg[x][y].first<=l) {
        return false;
    }
    return true;
}

int main() {
    scanf("%d %d %d %d",&m,&n,&k,&l);
    int xh,yh;
    int xv,yv;
    scanf("%d %d %d %d",&yh,&xh,&yv,&xv);
    int xs=xh;
    int ys=yv;
    int xe,ye;
    memset(p,-1,sizeof(p));
    for(int i=0;i<n;i++) {
        scanf("%s",s[i]);
        for(int j=0;j<m;j++) {
            if (s[i][j]=='*') {
                xe=i;
                ye=j;
            }
            if (s[i][j]=='X') {
                arr[i][j]=1;
                vx[i].push_back(j);
                vy[j].push_back(i);
            }
        }
    }
    for(int i=0;i<n;i++) {
        vx[i].push_back(-1);
        vx[i].push_back(m);
        sort(vx[i].begin(),vx[i].end());
    }
    for(int i=0;i<m;i++) {
        vy[i].push_back(-1);
        vy[i].push_back(n);
        sort(vy[i].begin(),vy[i].end());
    }
    for(int i=0;i<n;i++) {
        for(int j=0;j<m;j++) {
            if (arr[i][j]==1) {
                continue;
            }
            int ind=lower_bound(vy[j].begin(),vy[j].end(),i)-vy[j].begin();
            xg[i][j]=P(vy[j][ind-1],vy[j][ind]);
            ind=lower_bound(vx[i].begin(),vx[i].end(),j)-vx[i].begin();
            yg[i][j]=P(vx[i][ind-1],vx[i][ind]);
        }
    }
    for(int i=0;i<n;i++) {
        for(int j=0;j<m;j++) {
            if (arr[i][j]==1) {
                continue;
            }
            if (!func(i,j)) {
                continue;
            }
            for(int a=0;a<4;a++) {
                int nx=i+dx[a];
                int ny=j+dy[a];
                if (arr[nx][ny]==1) {
                    continue;
                }
                if (!func(nx,ny)) {
                    continue;
                }
                if (a&1) {
                    int one=max(xg[i][j].first,xg[nx][ny].first);
                    int two=min(xg[i][j].second,xg[nx][ny].second);
                    if (two-one>l) {
                        merge(i*m+j,nx*m+ny);
                    }
                }
                else {
                    int one=max(yg[i][j].first,yg[nx][ny].first);
                    int two=min(yg[i][j].second,yg[nx][ny].second);
                    if (two-one>k) {
                        merge(i*m+j,nx*m+ny);
                    }
                }
            }
        }
    }
    if (find(xs*m+ys)==find(xe*m+ye)) {
        printf("YES");
    }
    else {
        printf("NO");
    }
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:42:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   42 |     scanf("%d %d %d %d",&m,&n,&k,&l);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:45:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |     scanf("%d %d %d %d",&yh,&xh,&yv,&xv);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:51:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |         scanf("%s",s[i]);
      |         ~~~~~^~~~~~~~~~~
Main.cpp:119:31: warning: 'xe' may be used uninitialized in this function [-Wmaybe-uninitialized]
  119 |     if (find(xs*m+ys)==find(xe*m+ye)) {
      |                             ~~^~
Main.cpp:119:28: warning: 'ye' may be used uninitialized in this function [-Wmaybe-uninitialized]
  119 |     if (find(xs*m+ys)==find(xe*m+ye)) {
      |                        ~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 14168 KB Output is correct
2 Correct 5 ms 14080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 14168 KB Output is correct
2 Correct 5 ms 14080 KB Output is correct
3 Correct 5 ms 14168 KB Output is correct
4 Correct 5 ms 14616 KB Output is correct
5 Correct 5 ms 14684 KB Output is correct
6 Correct 5 ms 14592 KB Output is correct
7 Correct 5 ms 14684 KB Output is correct
8 Correct 5 ms 14684 KB Output is correct
9 Correct 5 ms 14428 KB Output is correct
10 Correct 5 ms 14684 KB Output is correct
11 Correct 5 ms 14684 KB Output is correct
12 Correct 5 ms 14112 KB Output is correct
13 Correct 5 ms 14684 KB Output is correct
14 Correct 4 ms 14684 KB Output is correct
15 Correct 5 ms 14528 KB Output is correct
16 Correct 4 ms 14472 KB Output is correct
17 Correct 6 ms 14680 KB Output is correct
18 Correct 5 ms 14684 KB Output is correct
19 Correct 5 ms 14936 KB Output is correct
20 Correct 5 ms 14684 KB Output is correct
21 Correct 6 ms 14580 KB Output is correct
22 Correct 5 ms 14684 KB Output is correct
23 Correct 5 ms 14772 KB Output is correct
24 Correct 5 ms 14684 KB Output is correct
25 Correct 6 ms 14684 KB Output is correct
26 Correct 5 ms 14780 KB Output is correct
27 Correct 5 ms 14684 KB Output is correct
28 Correct 6 ms 14684 KB Output is correct
29 Correct 5 ms 14684 KB Output is correct
30 Correct 5 ms 14684 KB Output is correct
31 Correct 5 ms 14732 KB Output is correct
32 Correct 5 ms 14684 KB Output is correct
33 Correct 6 ms 14684 KB Output is correct
34 Correct 5 ms 14684 KB Output is correct
35 Correct 5 ms 14724 KB Output is correct
36 Correct 5 ms 14684 KB Output is correct
37 Correct 5 ms 14576 KB Output is correct
38 Correct 5 ms 14632 KB Output is correct
39 Correct 5 ms 14684 KB Output is correct
40 Correct 6 ms 14684 KB Output is correct
41 Correct 5 ms 14684 KB Output is correct
42 Correct 6 ms 14684 KB Output is correct
43 Correct 5 ms 14684 KB Output is correct
44 Correct 5 ms 14684 KB Output is correct
45 Correct 5 ms 14528 KB Output is correct
46 Correct 5 ms 14684 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 14168 KB Output is correct
2 Correct 5 ms 14080 KB Output is correct
3 Correct 5 ms 14168 KB Output is correct
4 Correct 5 ms 14616 KB Output is correct
5 Correct 5 ms 14684 KB Output is correct
6 Correct 5 ms 14592 KB Output is correct
7 Correct 5 ms 14684 KB Output is correct
8 Correct 5 ms 14684 KB Output is correct
9 Correct 5 ms 14428 KB Output is correct
10 Correct 5 ms 14684 KB Output is correct
11 Correct 5 ms 14684 KB Output is correct
12 Correct 5 ms 14112 KB Output is correct
13 Correct 5 ms 14684 KB Output is correct
14 Correct 4 ms 14684 KB Output is correct
15 Correct 5 ms 14528 KB Output is correct
16 Correct 4 ms 14472 KB Output is correct
17 Correct 6 ms 14680 KB Output is correct
18 Correct 5 ms 14684 KB Output is correct
19 Correct 5 ms 14936 KB Output is correct
20 Correct 5 ms 14684 KB Output is correct
21 Correct 6 ms 14580 KB Output is correct
22 Correct 5 ms 14684 KB Output is correct
23 Correct 5 ms 14772 KB Output is correct
24 Correct 5 ms 14684 KB Output is correct
25 Correct 6 ms 14684 KB Output is correct
26 Correct 5 ms 14780 KB Output is correct
27 Correct 5 ms 14684 KB Output is correct
28 Correct 6 ms 14684 KB Output is correct
29 Correct 5 ms 14684 KB Output is correct
30 Correct 5 ms 14684 KB Output is correct
31 Correct 5 ms 14732 KB Output is correct
32 Correct 5 ms 14684 KB Output is correct
33 Correct 6 ms 14684 KB Output is correct
34 Correct 5 ms 14684 KB Output is correct
35 Correct 5 ms 14724 KB Output is correct
36 Correct 5 ms 14684 KB Output is correct
37 Correct 5 ms 14576 KB Output is correct
38 Correct 5 ms 14632 KB Output is correct
39 Correct 5 ms 14684 KB Output is correct
40 Correct 6 ms 14684 KB Output is correct
41 Correct 5 ms 14684 KB Output is correct
42 Correct 6 ms 14684 KB Output is correct
43 Correct 5 ms 14684 KB Output is correct
44 Correct 5 ms 14684 KB Output is correct
45 Correct 5 ms 14528 KB Output is correct
46 Correct 5 ms 14684 KB Output is correct
47 Correct 5 ms 14428 KB Output is correct
48 Correct 5 ms 15196 KB Output is correct
49 Correct 5 ms 15196 KB Output is correct
50 Correct 5 ms 15196 KB Output is correct
51 Correct 5 ms 15196 KB Output is correct
52 Correct 5 ms 15192 KB Output is correct
53 Correct 5 ms 14864 KB Output is correct
54 Correct 5 ms 15196 KB Output is correct
55 Correct 5 ms 15196 KB Output is correct
56 Correct 5 ms 15196 KB Output is correct
57 Correct 6 ms 15448 KB Output is correct
58 Correct 6 ms 15452 KB Output is correct
59 Correct 6 ms 15196 KB Output is correct
60 Correct 5 ms 15196 KB Output is correct
61 Correct 5 ms 14940 KB Output is correct
62 Correct 5 ms 15092 KB Output is correct
63 Correct 8 ms 15332 KB Output is correct
64 Correct 5 ms 15196 KB Output is correct
65 Correct 5 ms 15208 KB Output is correct
66 Correct 5 ms 15240 KB Output is correct
67 Correct 5 ms 15192 KB Output is correct
68 Correct 5 ms 15196 KB Output is correct
69 Correct 6 ms 15196 KB Output is correct
70 Correct 5 ms 15120 KB Output is correct
71 Correct 6 ms 15196 KB Output is correct
72 Correct 6 ms 15196 KB Output is correct
73 Correct 6 ms 15196 KB Output is correct
74 Correct 5 ms 15188 KB Output is correct
75 Correct 6 ms 14940 KB Output is correct
76 Correct 5 ms 15060 KB Output is correct
77 Correct 6 ms 15196 KB Output is correct
78 Correct 5 ms 15196 KB Output is correct
79 Correct 6 ms 15196 KB Output is correct
80 Correct 5 ms 15196 KB Output is correct
81 Correct 5 ms 15080 KB Output is correct
82 Correct 7 ms 15196 KB Output is correct
83 Correct 5 ms 15196 KB Output is correct
84 Correct 5 ms 15196 KB Output is correct
85 Correct 5 ms 15196 KB Output is correct
86 Correct 6 ms 15192 KB Output is correct
87 Correct 6 ms 15196 KB Output is correct
88 Correct 5 ms 15196 KB Output is correct
89 Correct 5 ms 15196 KB Output is correct
90 Correct 5 ms 15196 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 14168 KB Output is correct
2 Correct 5 ms 14080 KB Output is correct
3 Correct 5 ms 14428 KB Output is correct
4 Correct 10 ms 18684 KB Output is correct
5 Correct 10 ms 18708 KB Output is correct
6 Correct 6 ms 14940 KB Output is correct
7 Correct 11 ms 19548 KB Output is correct
8 Correct 11 ms 19436 KB Output is correct
9 Correct 7 ms 16040 KB Output is correct
10 Correct 12 ms 19804 KB Output is correct
11 Correct 12 ms 19928 KB Output is correct
12 Correct 8 ms 18008 KB Output is correct
13 Correct 12 ms 20312 KB Output is correct
14 Correct 12 ms 20056 KB Output is correct
15 Correct 10 ms 18268 KB Output is correct
16 Correct 9 ms 18012 KB Output is correct
17 Correct 9 ms 18268 KB Output is correct
18 Correct 9 ms 18364 KB Output is correct
19 Correct 10 ms 18524 KB Output is correct
20 Correct 10 ms 18524 KB Output is correct
21 Correct 10 ms 18524 KB Output is correct
22 Correct 10 ms 18520 KB Output is correct
23 Correct 10 ms 18524 KB Output is correct
24 Correct 10 ms 18780 KB Output is correct
25 Correct 10 ms 18928 KB Output is correct
26 Correct 10 ms 19036 KB Output is correct
27 Correct 10 ms 19016 KB Output is correct
28 Correct 10 ms 19036 KB Output is correct
29 Correct 10 ms 19032 KB Output is correct
30 Correct 10 ms 18268 KB Output is correct
31 Correct 10 ms 18268 KB Output is correct
32 Correct 10 ms 18268 KB Output is correct
33 Correct 9 ms 18072 KB Output is correct
34 Correct 10 ms 18044 KB Output is correct
35 Correct 9 ms 18212 KB Output is correct
36 Correct 8 ms 19548 KB Output is correct
37 Correct 10 ms 18780 KB Output is correct
38 Correct 10 ms 18780 KB Output is correct
39 Correct 10 ms 18776 KB Output is correct
40 Correct 10 ms 18780 KB Output is correct
41 Correct 10 ms 18940 KB Output is correct
42 Correct 10 ms 18388 KB Output is correct
43 Correct 10 ms 18776 KB Output is correct
44 Correct 10 ms 18512 KB Output is correct
45 Correct 10 ms 18324 KB Output is correct
46 Correct 9 ms 19288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 14168 KB Output is correct
2 Correct 5 ms 14080 KB Output is correct
3 Correct 5 ms 14168 KB Output is correct
4 Correct 5 ms 14616 KB Output is correct
5 Correct 5 ms 14684 KB Output is correct
6 Correct 5 ms 14592 KB Output is correct
7 Correct 5 ms 14684 KB Output is correct
8 Correct 5 ms 14684 KB Output is correct
9 Correct 5 ms 14428 KB Output is correct
10 Correct 5 ms 14684 KB Output is correct
11 Correct 5 ms 14684 KB Output is correct
12 Correct 5 ms 14112 KB Output is correct
13 Correct 5 ms 14684 KB Output is correct
14 Correct 4 ms 14684 KB Output is correct
15 Correct 5 ms 14528 KB Output is correct
16 Correct 4 ms 14472 KB Output is correct
17 Correct 6 ms 14680 KB Output is correct
18 Correct 5 ms 14684 KB Output is correct
19 Correct 5 ms 14936 KB Output is correct
20 Correct 5 ms 14684 KB Output is correct
21 Correct 6 ms 14580 KB Output is correct
22 Correct 5 ms 14684 KB Output is correct
23 Correct 5 ms 14772 KB Output is correct
24 Correct 5 ms 14684 KB Output is correct
25 Correct 6 ms 14684 KB Output is correct
26 Correct 5 ms 14780 KB Output is correct
27 Correct 5 ms 14684 KB Output is correct
28 Correct 6 ms 14684 KB Output is correct
29 Correct 5 ms 14684 KB Output is correct
30 Correct 5 ms 14684 KB Output is correct
31 Correct 5 ms 14732 KB Output is correct
32 Correct 5 ms 14684 KB Output is correct
33 Correct 6 ms 14684 KB Output is correct
34 Correct 5 ms 14684 KB Output is correct
35 Correct 5 ms 14724 KB Output is correct
36 Correct 5 ms 14684 KB Output is correct
37 Correct 5 ms 14576 KB Output is correct
38 Correct 5 ms 14632 KB Output is correct
39 Correct 5 ms 14684 KB Output is correct
40 Correct 6 ms 14684 KB Output is correct
41 Correct 5 ms 14684 KB Output is correct
42 Correct 6 ms 14684 KB Output is correct
43 Correct 5 ms 14684 KB Output is correct
44 Correct 5 ms 14684 KB Output is correct
45 Correct 5 ms 14528 KB Output is correct
46 Correct 5 ms 14684 KB Output is correct
47 Correct 5 ms 14428 KB Output is correct
48 Correct 5 ms 15196 KB Output is correct
49 Correct 5 ms 15196 KB Output is correct
50 Correct 5 ms 15196 KB Output is correct
51 Correct 5 ms 15196 KB Output is correct
52 Correct 5 ms 15192 KB Output is correct
53 Correct 5 ms 14864 KB Output is correct
54 Correct 5 ms 15196 KB Output is correct
55 Correct 5 ms 15196 KB Output is correct
56 Correct 5 ms 15196 KB Output is correct
57 Correct 6 ms 15448 KB Output is correct
58 Correct 6 ms 15452 KB Output is correct
59 Correct 6 ms 15196 KB Output is correct
60 Correct 5 ms 15196 KB Output is correct
61 Correct 5 ms 14940 KB Output is correct
62 Correct 5 ms 15092 KB Output is correct
63 Correct 8 ms 15332 KB Output is correct
64 Correct 5 ms 15196 KB Output is correct
65 Correct 5 ms 15208 KB Output is correct
66 Correct 5 ms 15240 KB Output is correct
67 Correct 5 ms 15192 KB Output is correct
68 Correct 5 ms 15196 KB Output is correct
69 Correct 6 ms 15196 KB Output is correct
70 Correct 5 ms 15120 KB Output is correct
71 Correct 6 ms 15196 KB Output is correct
72 Correct 6 ms 15196 KB Output is correct
73 Correct 6 ms 15196 KB Output is correct
74 Correct 5 ms 15188 KB Output is correct
75 Correct 6 ms 14940 KB Output is correct
76 Correct 5 ms 15060 KB Output is correct
77 Correct 6 ms 15196 KB Output is correct
78 Correct 5 ms 15196 KB Output is correct
79 Correct 6 ms 15196 KB Output is correct
80 Correct 5 ms 15196 KB Output is correct
81 Correct 5 ms 15080 KB Output is correct
82 Correct 7 ms 15196 KB Output is correct
83 Correct 5 ms 15196 KB Output is correct
84 Correct 5 ms 15196 KB Output is correct
85 Correct 5 ms 15196 KB Output is correct
86 Correct 6 ms 15192 KB Output is correct
87 Correct 6 ms 15196 KB Output is correct
88 Correct 5 ms 15196 KB Output is correct
89 Correct 5 ms 15196 KB Output is correct
90 Correct 5 ms 15196 KB Output is correct
91 Correct 5 ms 14428 KB Output is correct
92 Correct 10 ms 18684 KB Output is correct
93 Correct 10 ms 18708 KB Output is correct
94 Correct 6 ms 14940 KB Output is correct
95 Correct 11 ms 19548 KB Output is correct
96 Correct 11 ms 19436 KB Output is correct
97 Correct 7 ms 16040 KB Output is correct
98 Correct 12 ms 19804 KB Output is correct
99 Correct 12 ms 19928 KB Output is correct
100 Correct 8 ms 18008 KB Output is correct
101 Correct 12 ms 20312 KB Output is correct
102 Correct 12 ms 20056 KB Output is correct
103 Correct 10 ms 18268 KB Output is correct
104 Correct 9 ms 18012 KB Output is correct
105 Correct 9 ms 18268 KB Output is correct
106 Correct 9 ms 18364 KB Output is correct
107 Correct 10 ms 18524 KB Output is correct
108 Correct 10 ms 18524 KB Output is correct
109 Correct 10 ms 18524 KB Output is correct
110 Correct 10 ms 18520 KB Output is correct
111 Correct 10 ms 18524 KB Output is correct
112 Correct 10 ms 18780 KB Output is correct
113 Correct 10 ms 18928 KB Output is correct
114 Correct 10 ms 19036 KB Output is correct
115 Correct 10 ms 19016 KB Output is correct
116 Correct 10 ms 19036 KB Output is correct
117 Correct 10 ms 19032 KB Output is correct
118 Correct 10 ms 18268 KB Output is correct
119 Correct 10 ms 18268 KB Output is correct
120 Correct 10 ms 18268 KB Output is correct
121 Correct 9 ms 18072 KB Output is correct
122 Correct 10 ms 18044 KB Output is correct
123 Correct 9 ms 18212 KB Output is correct
124 Correct 8 ms 19548 KB Output is correct
125 Correct 10 ms 18780 KB Output is correct
126 Correct 10 ms 18780 KB Output is correct
127 Correct 10 ms 18776 KB Output is correct
128 Correct 10 ms 18780 KB Output is correct
129 Correct 10 ms 18940 KB Output is correct
130 Correct 10 ms 18388 KB Output is correct
131 Correct 10 ms 18776 KB Output is correct
132 Correct 10 ms 18512 KB Output is correct
133 Correct 10 ms 18324 KB Output is correct
134 Correct 9 ms 19288 KB Output is correct
135 Correct 7 ms 16988 KB Output is correct
136 Correct 12 ms 20060 KB Output is correct
137 Correct 10 ms 20060 KB Output is correct
138 Correct 9 ms 16988 KB Output is correct
139 Correct 12 ms 21084 KB Output is correct
140 Correct 9 ms 21044 KB Output is correct
141 Correct 9 ms 19544 KB Output is correct
142 Correct 12 ms 21340 KB Output is correct
143 Correct 13 ms 21340 KB Output is correct
144 Correct 5 ms 14428 KB Output is correct
145 Correct 18 ms 22000 KB Output is correct
146 Correct 15 ms 22104 KB Output is correct
147 Correct 11 ms 19292 KB Output is correct
148 Correct 11 ms 19292 KB Output is correct
149 Correct 10 ms 18944 KB Output is correct
150 Correct 12 ms 19548 KB Output is correct
151 Correct 12 ms 19548 KB Output is correct
152 Correct 11 ms 19648 KB Output is correct
153 Correct 12 ms 19548 KB Output is correct
154 Correct 12 ms 19548 KB Output is correct
155 Correct 12 ms 19544 KB Output is correct
156 Correct 12 ms 20056 KB Output is correct
157 Correct 12 ms 20060 KB Output is correct
158 Correct 13 ms 20572 KB Output is correct
159 Correct 12 ms 20572 KB Output is correct
160 Correct 13 ms 20572 KB Output is correct
161 Correct 12 ms 20360 KB Output is correct
162 Correct 11 ms 19256 KB Output is correct
163 Correct 12 ms 19292 KB Output is correct
164 Correct 11 ms 19548 KB Output is correct
165 Correct 11 ms 19168 KB Output is correct
166 Correct 11 ms 19372 KB Output is correct
167 Correct 11 ms 19036 KB Output is correct
168 Correct 11 ms 21084 KB Output is correct
169 Correct 12 ms 20108 KB Output is correct
170 Correct 12 ms 20056 KB Output is correct
171 Correct 11 ms 19804 KB Output is correct
172 Correct 10 ms 19828 KB Output is correct
173 Correct 12 ms 20060 KB Output is correct
174 Correct 12 ms 19684 KB Output is correct
175 Correct 12 ms 19548 KB Output is correct
176 Correct 12 ms 19548 KB Output is correct
177 Correct 12 ms 19680 KB Output is correct
178 Correct 10 ms 20572 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 14168 KB Output is correct
2 Correct 5 ms 14080 KB Output is correct
3 Correct 5 ms 14168 KB Output is correct
4 Correct 5 ms 14616 KB Output is correct
5 Correct 5 ms 14684 KB Output is correct
6 Correct 5 ms 14592 KB Output is correct
7 Correct 5 ms 14684 KB Output is correct
8 Correct 5 ms 14684 KB Output is correct
9 Correct 5 ms 14428 KB Output is correct
10 Correct 5 ms 14684 KB Output is correct
11 Correct 5 ms 14684 KB Output is correct
12 Correct 5 ms 14112 KB Output is correct
13 Correct 5 ms 14684 KB Output is correct
14 Correct 4 ms 14684 KB Output is correct
15 Correct 5 ms 14528 KB Output is correct
16 Correct 4 ms 14472 KB Output is correct
17 Correct 6 ms 14680 KB Output is correct
18 Correct 5 ms 14684 KB Output is correct
19 Correct 5 ms 14936 KB Output is correct
20 Correct 5 ms 14684 KB Output is correct
21 Correct 6 ms 14580 KB Output is correct
22 Correct 5 ms 14684 KB Output is correct
23 Correct 5 ms 14772 KB Output is correct
24 Correct 5 ms 14684 KB Output is correct
25 Correct 6 ms 14684 KB Output is correct
26 Correct 5 ms 14780 KB Output is correct
27 Correct 5 ms 14684 KB Output is correct
28 Correct 6 ms 14684 KB Output is correct
29 Correct 5 ms 14684 KB Output is correct
30 Correct 5 ms 14684 KB Output is correct
31 Correct 5 ms 14732 KB Output is correct
32 Correct 5 ms 14684 KB Output is correct
33 Correct 6 ms 14684 KB Output is correct
34 Correct 5 ms 14684 KB Output is correct
35 Correct 5 ms 14724 KB Output is correct
36 Correct 5 ms 14684 KB Output is correct
37 Correct 5 ms 14576 KB Output is correct
38 Correct 5 ms 14632 KB Output is correct
39 Correct 5 ms 14684 KB Output is correct
40 Correct 6 ms 14684 KB Output is correct
41 Correct 5 ms 14684 KB Output is correct
42 Correct 6 ms 14684 KB Output is correct
43 Correct 5 ms 14684 KB Output is correct
44 Correct 5 ms 14684 KB Output is correct
45 Correct 5 ms 14528 KB Output is correct
46 Correct 5 ms 14684 KB Output is correct
47 Correct 5 ms 14428 KB Output is correct
48 Correct 5 ms 15196 KB Output is correct
49 Correct 5 ms 15196 KB Output is correct
50 Correct 5 ms 15196 KB Output is correct
51 Correct 5 ms 15196 KB Output is correct
52 Correct 5 ms 15192 KB Output is correct
53 Correct 5 ms 14864 KB Output is correct
54 Correct 5 ms 15196 KB Output is correct
55 Correct 5 ms 15196 KB Output is correct
56 Correct 5 ms 15196 KB Output is correct
57 Correct 6 ms 15448 KB Output is correct
58 Correct 6 ms 15452 KB Output is correct
59 Correct 6 ms 15196 KB Output is correct
60 Correct 5 ms 15196 KB Output is correct
61 Correct 5 ms 14940 KB Output is correct
62 Correct 5 ms 15092 KB Output is correct
63 Correct 8 ms 15332 KB Output is correct
64 Correct 5 ms 15196 KB Output is correct
65 Correct 5 ms 15208 KB Output is correct
66 Correct 5 ms 15240 KB Output is correct
67 Correct 5 ms 15192 KB Output is correct
68 Correct 5 ms 15196 KB Output is correct
69 Correct 6 ms 15196 KB Output is correct
70 Correct 5 ms 15120 KB Output is correct
71 Correct 6 ms 15196 KB Output is correct
72 Correct 6 ms 15196 KB Output is correct
73 Correct 6 ms 15196 KB Output is correct
74 Correct 5 ms 15188 KB Output is correct
75 Correct 6 ms 14940 KB Output is correct
76 Correct 5 ms 15060 KB Output is correct
77 Correct 6 ms 15196 KB Output is correct
78 Correct 5 ms 15196 KB Output is correct
79 Correct 6 ms 15196 KB Output is correct
80 Correct 5 ms 15196 KB Output is correct
81 Correct 5 ms 15080 KB Output is correct
82 Correct 7 ms 15196 KB Output is correct
83 Correct 5 ms 15196 KB Output is correct
84 Correct 5 ms 15196 KB Output is correct
85 Correct 5 ms 15196 KB Output is correct
86 Correct 6 ms 15192 KB Output is correct
87 Correct 6 ms 15196 KB Output is correct
88 Correct 5 ms 15196 KB Output is correct
89 Correct 5 ms 15196 KB Output is correct
90 Correct 5 ms 15196 KB Output is correct
91 Correct 5 ms 14428 KB Output is correct
92 Correct 10 ms 18684 KB Output is correct
93 Correct 10 ms 18708 KB Output is correct
94 Correct 6 ms 14940 KB Output is correct
95 Correct 11 ms 19548 KB Output is correct
96 Correct 11 ms 19436 KB Output is correct
97 Correct 7 ms 16040 KB Output is correct
98 Correct 12 ms 19804 KB Output is correct
99 Correct 12 ms 19928 KB Output is correct
100 Correct 8 ms 18008 KB Output is correct
101 Correct 12 ms 20312 KB Output is correct
102 Correct 12 ms 20056 KB Output is correct
103 Correct 10 ms 18268 KB Output is correct
104 Correct 9 ms 18012 KB Output is correct
105 Correct 9 ms 18268 KB Output is correct
106 Correct 9 ms 18364 KB Output is correct
107 Correct 10 ms 18524 KB Output is correct
108 Correct 10 ms 18524 KB Output is correct
109 Correct 10 ms 18524 KB Output is correct
110 Correct 10 ms 18520 KB Output is correct
111 Correct 10 ms 18524 KB Output is correct
112 Correct 10 ms 18780 KB Output is correct
113 Correct 10 ms 18928 KB Output is correct
114 Correct 10 ms 19036 KB Output is correct
115 Correct 10 ms 19016 KB Output is correct
116 Correct 10 ms 19036 KB Output is correct
117 Correct 10 ms 19032 KB Output is correct
118 Correct 10 ms 18268 KB Output is correct
119 Correct 10 ms 18268 KB Output is correct
120 Correct 10 ms 18268 KB Output is correct
121 Correct 9 ms 18072 KB Output is correct
122 Correct 10 ms 18044 KB Output is correct
123 Correct 9 ms 18212 KB Output is correct
124 Correct 8 ms 19548 KB Output is correct
125 Correct 10 ms 18780 KB Output is correct
126 Correct 10 ms 18780 KB Output is correct
127 Correct 10 ms 18776 KB Output is correct
128 Correct 10 ms 18780 KB Output is correct
129 Correct 10 ms 18940 KB Output is correct
130 Correct 10 ms 18388 KB Output is correct
131 Correct 10 ms 18776 KB Output is correct
132 Correct 10 ms 18512 KB Output is correct
133 Correct 10 ms 18324 KB Output is correct
134 Correct 9 ms 19288 KB Output is correct
135 Correct 7 ms 16988 KB Output is correct
136 Correct 12 ms 20060 KB Output is correct
137 Correct 10 ms 20060 KB Output is correct
138 Correct 9 ms 16988 KB Output is correct
139 Correct 12 ms 21084 KB Output is correct
140 Correct 9 ms 21044 KB Output is correct
141 Correct 9 ms 19544 KB Output is correct
142 Correct 12 ms 21340 KB Output is correct
143 Correct 13 ms 21340 KB Output is correct
144 Correct 5 ms 14428 KB Output is correct
145 Correct 18 ms 22000 KB Output is correct
146 Correct 15 ms 22104 KB Output is correct
147 Correct 11 ms 19292 KB Output is correct
148 Correct 11 ms 19292 KB Output is correct
149 Correct 10 ms 18944 KB Output is correct
150 Correct 12 ms 19548 KB Output is correct
151 Correct 12 ms 19548 KB Output is correct
152 Correct 11 ms 19648 KB Output is correct
153 Correct 12 ms 19548 KB Output is correct
154 Correct 12 ms 19548 KB Output is correct
155 Correct 12 ms 19544 KB Output is correct
156 Correct 12 ms 20056 KB Output is correct
157 Correct 12 ms 20060 KB Output is correct
158 Correct 13 ms 20572 KB Output is correct
159 Correct 12 ms 20572 KB Output is correct
160 Correct 13 ms 20572 KB Output is correct
161 Correct 12 ms 20360 KB Output is correct
162 Correct 11 ms 19256 KB Output is correct
163 Correct 12 ms 19292 KB Output is correct
164 Correct 11 ms 19548 KB Output is correct
165 Correct 11 ms 19168 KB Output is correct
166 Correct 11 ms 19372 KB Output is correct
167 Correct 11 ms 19036 KB Output is correct
168 Correct 11 ms 21084 KB Output is correct
169 Correct 12 ms 20108 KB Output is correct
170 Correct 12 ms 20056 KB Output is correct
171 Correct 11 ms 19804 KB Output is correct
172 Correct 10 ms 19828 KB Output is correct
173 Correct 12 ms 20060 KB Output is correct
174 Correct 12 ms 19684 KB Output is correct
175 Correct 12 ms 19548 KB Output is correct
176 Correct 12 ms 19548 KB Output is correct
177 Correct 12 ms 19680 KB Output is correct
178 Correct 10 ms 20572 KB Output is correct
179 Correct 33 ms 32856 KB Output is correct
180 Correct 81 ms 55312 KB Output is correct
181 Correct 55 ms 55300 KB Output is correct
182 Correct 26 ms 37968 KB Output is correct
183 Correct 83 ms 58708 KB Output is correct
184 Correct 84 ms 58704 KB Output is correct
185 Correct 124 ms 56912 KB Output is correct
186 Correct 162 ms 61800 KB Output is correct
187 Correct 165 ms 61860 KB Output is correct
188 Correct 101 ms 54608 KB Output is correct
189 Correct 197 ms 71764 KB Output is correct
190 Correct 195 ms 71428 KB Output is correct
191 Correct 87 ms 47952 KB Output is correct
192 Correct 95 ms 49688 KB Output is correct
193 Correct 92 ms 48208 KB Output is correct
194 Correct 100 ms 50068 KB Output is correct
195 Correct 100 ms 49864 KB Output is correct
196 Correct 100 ms 50096 KB Output is correct
197 Correct 106 ms 49984 KB Output is correct
198 Correct 101 ms 50088 KB Output is correct
199 Correct 104 ms 50004 KB Output is correct
200 Correct 101 ms 52816 KB Output is correct
201 Correct 101 ms 52836 KB Output is correct
202 Correct 102 ms 54364 KB Output is correct
203 Correct 101 ms 54408 KB Output is correct
204 Correct 102 ms 54352 KB Output is correct
205 Correct 106 ms 54404 KB Output is correct
206 Correct 91 ms 49232 KB Output is correct
207 Correct 91 ms 48496 KB Output is correct
208 Correct 87 ms 48644 KB Output is correct
209 Correct 94 ms 49520 KB Output is correct
210 Correct 91 ms 48724 KB Output is correct
211 Correct 98 ms 49244 KB Output is correct
212 Correct 64 ms 61264 KB Output is correct
213 Correct 93 ms 51548 KB Output is correct
214 Correct 98 ms 51628 KB Output is correct
215 Correct 96 ms 52048 KB Output is correct
216 Correct 88 ms 51200 KB Output is correct
217 Correct 90 ms 52052 KB Output is correct
218 Correct 101 ms 50000 KB Output is correct
219 Correct 102 ms 50000 KB Output is correct
220 Correct 101 ms 50096 KB Output is correct
221 Correct 102 ms 49996 KB Output is correct
222 Correct 78 ms 57384 KB Output is correct