답안 #1045754

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1045754 2024-08-06T07:24:37 Z gagik_2007 Toy (CEOI24_toy) C++17
100 / 100
571 ms 518652 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define ff first
#define ss second

ll ttt;
const ll INF=1e18;
const ll MOD=1e9+7;
const ll N=2007;
ll n,m,k;
int h, v;
bool dp[N][N];
bool vis[N][N];
bool d[N][N];
int pf[2*N][2*N];
int colpf[2*N][2*N];
int tgi,tgj;

int getPf(int i, int j1, int j2){
    if(j1==0)return pf[i][j2];
    return pf[i][j2]-pf[i][j1-1];
}

int getColPf(int j, int i1, int i2){
    if(i1==0)return colpf[j][i2];
    return colpf[j][i2]-colpf[j][i1-1];
}

void recurs(int i, int j){
    if(vis[i][j])return;
    vis[i][j]=true;
    if(!dp[i][j])return;
    // cout<<i<<" "<<j<<endl;

    //left
    if(j>0&&!d[i][j-1]){
        for(int vi=max(0,i-v+1);vi<=i&&vi+v<=n;vi++){
            if(getColPf(j,vi,vi+v-1)==0 &&
                getColPf(j-1,vi,vi+v-1)==0){
                dp[i][j-1]=true;
                recurs(i,j-1);
                break;
            }
        }
    }
    //right
    if(j<m-1&&!d[i][j+1]){
        for(int vi=max(0,i-v+1);vi<=i&&vi+v<=n;vi++){
            if(getColPf(j,vi,vi+v-1)==0 &&
                getColPf(j+1,vi,vi+v-1)==0){
                dp[i][j+1]=true;
                recurs(i,j+1);
                break;
            }
        }
    }
    //up
    if(i>0&&!d[i-1][j]){
        // cout<<"OK "<<i<<" "<<j<<endl;
        for(int hj=max(0,j-h+1);hj<=j&&hj+h<=m;hj++){
            // cout<<hj<<": "<<getPf(i,hj,hj+h-1)<<", "<<getPf(i-1,hj,hj+h-1)<<endl;
            if(getPf(i,hj,hj+h-1)==0 &&
                getPf(i-1,hj,hj+h-1)==0){
                dp[i-1][j]=true;
                recurs(i-1,j);
                break;
            }
        }
    }
    //down
    if(i<n-1&&!d[i+1][j]){
        for(int hj=max(0,j-h+1);hj<=j&&hj+h<=m;hj++){
            if(getPf(i,hj,hj+h-1)==0 &&
                getPf(i+1,hj,hj+h-1)==0){
                dp[i+1][j]=true;
                recurs(i+1,j);
                break;
            }
        }
    }
}

void calculatePfs(){
    for(int i=0;i<n;i++){
        pf[i][0]=d[i][0];
        for(int j=1;j<2*m;j++){
            pf[i][j]=pf[i][j-1]+d[i][j];
        }
    }
    for(int j=0;j<m;j++){
        colpf[j][0]=d[0][j];
        for(int i=1;i<2*n;i++){
            colpf[j][i]=colpf[j][i-1]+d[i][j];
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // freopen("Dinput.txt","r",stdin);
    // freopen("Doutput.txt","w",stdout);
    cin>>m>>n;
    cin>>h>>v;
    int i1,i2,j1,j2;
    cin>>j1>>i1>>j2>>i2;
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            char c;
            cin>>c;
            // cout<<c;
            if(c=='X'){
                d[i][j]=true;
            }
            if(c=='*'){
                tgi=i;
                tgj=j;
                // cout<<i<<" "<<j<<endl;
            }
        }
        // cout<<endl;
    }
    calculatePfs();
    int ii=i1;
    int jj=j2;
    dp[ii][jj]=true;
    recurs(ii,jj);
    if(dp[tgi][tgj]){
        // cout<<tgi<<" "<<tgj<<endl;
        // cout<<lh<<" "<<lv<<endl;
        cout<<"YES"<<endl;
        return 0;
    }
    cout<<"NO"<<endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6748 KB Output is correct
4 Correct 1 ms 11100 KB Output is correct
5 Correct 2 ms 10844 KB Output is correct
6 Correct 1 ms 6492 KB Output is correct
7 Correct 1 ms 10588 KB Output is correct
8 Correct 1 ms 10588 KB Output is correct
9 Correct 1 ms 8540 KB Output is correct
10 Correct 1 ms 10588 KB Output is correct
11 Correct 1 ms 10588 KB Output is correct
12 Correct 1 ms 6492 KB Output is correct
13 Correct 1 ms 10588 KB Output is correct
14 Correct 1 ms 10588 KB Output is correct
15 Correct 1 ms 11100 KB Output is correct
16 Correct 1 ms 9052 KB Output is correct
17 Correct 1 ms 9052 KB Output is correct
18 Correct 1 ms 11356 KB Output is correct
19 Correct 1 ms 11356 KB Output is correct
20 Correct 1 ms 11356 KB Output is correct
21 Correct 1 ms 9308 KB Output is correct
22 Correct 1 ms 9308 KB Output is correct
23 Correct 2 ms 9308 KB Output is correct
24 Correct 1 ms 11100 KB Output is correct
25 Correct 1 ms 11100 KB Output is correct
26 Correct 2 ms 11100 KB Output is correct
27 Correct 1 ms 11100 KB Output is correct
28 Correct 2 ms 11100 KB Output is correct
29 Correct 1 ms 11100 KB Output is correct
30 Correct 2 ms 9048 KB Output is correct
31 Correct 1 ms 11100 KB Output is correct
32 Correct 2 ms 9052 KB Output is correct
33 Correct 2 ms 11100 KB Output is correct
34 Correct 1 ms 11100 KB Output is correct
35 Correct 1 ms 11100 KB Output is correct
36 Correct 1 ms 10588 KB Output is correct
37 Correct 1 ms 8876 KB Output is correct
38 Correct 1 ms 10844 KB Output is correct
39 Correct 1 ms 8796 KB Output is correct
40 Correct 1 ms 10844 KB Output is correct
41 Correct 1 ms 10980 KB Output is correct
42 Correct 2 ms 9052 KB Output is correct
43 Correct 1 ms 9052 KB Output is correct
44 Correct 2 ms 9052 KB Output is correct
45 Correct 1 ms 9308 KB Output is correct
46 Correct 1 ms 8540 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6748 KB Output is correct
4 Correct 1 ms 11100 KB Output is correct
5 Correct 2 ms 10844 KB Output is correct
6 Correct 1 ms 6492 KB Output is correct
7 Correct 1 ms 10588 KB Output is correct
8 Correct 1 ms 10588 KB Output is correct
9 Correct 1 ms 8540 KB Output is correct
10 Correct 1 ms 10588 KB Output is correct
11 Correct 1 ms 10588 KB Output is correct
12 Correct 1 ms 6492 KB Output is correct
13 Correct 1 ms 10588 KB Output is correct
14 Correct 1 ms 10588 KB Output is correct
15 Correct 1 ms 11100 KB Output is correct
16 Correct 1 ms 9052 KB Output is correct
17 Correct 1 ms 9052 KB Output is correct
18 Correct 1 ms 11356 KB Output is correct
19 Correct 1 ms 11356 KB Output is correct
20 Correct 1 ms 11356 KB Output is correct
21 Correct 1 ms 9308 KB Output is correct
22 Correct 1 ms 9308 KB Output is correct
23 Correct 2 ms 9308 KB Output is correct
24 Correct 1 ms 11100 KB Output is correct
25 Correct 1 ms 11100 KB Output is correct
26 Correct 2 ms 11100 KB Output is correct
27 Correct 1 ms 11100 KB Output is correct
28 Correct 2 ms 11100 KB Output is correct
29 Correct 1 ms 11100 KB Output is correct
30 Correct 2 ms 9048 KB Output is correct
31 Correct 1 ms 11100 KB Output is correct
32 Correct 2 ms 9052 KB Output is correct
33 Correct 2 ms 11100 KB Output is correct
34 Correct 1 ms 11100 KB Output is correct
35 Correct 1 ms 11100 KB Output is correct
36 Correct 1 ms 10588 KB Output is correct
37 Correct 1 ms 8876 KB Output is correct
38 Correct 1 ms 10844 KB Output is correct
39 Correct 1 ms 8796 KB Output is correct
40 Correct 1 ms 10844 KB Output is correct
41 Correct 1 ms 10980 KB Output is correct
42 Correct 2 ms 9052 KB Output is correct
43 Correct 1 ms 9052 KB Output is correct
44 Correct 2 ms 9052 KB Output is correct
45 Correct 1 ms 9308 KB Output is correct
46 Correct 1 ms 8540 KB Output is correct
47 Correct 2 ms 8796 KB Output is correct
48 Correct 1 ms 10588 KB Output is correct
49 Correct 1 ms 10844 KB Output is correct
50 Correct 1 ms 10588 KB Output is correct
51 Correct 1 ms 10844 KB Output is correct
52 Correct 1 ms 10588 KB Output is correct
53 Correct 1 ms 10588 KB Output is correct
54 Correct 1 ms 10588 KB Output is correct
55 Correct 1 ms 10588 KB Output is correct
56 Correct 1 ms 10588 KB Output is correct
57 Correct 1 ms 10588 KB Output is correct
58 Correct 1 ms 10588 KB Output is correct
59 Correct 2 ms 11612 KB Output is correct
60 Correct 2 ms 11612 KB Output is correct
61 Correct 2 ms 11612 KB Output is correct
62 Correct 2 ms 12380 KB Output is correct
63 Correct 3 ms 12380 KB Output is correct
64 Correct 3 ms 12500 KB Output is correct
65 Correct 2 ms 10340 KB Output is correct
66 Correct 2 ms 10336 KB Output is correct
67 Correct 3 ms 10340 KB Output is correct
68 Correct 2 ms 12000 KB Output is correct
69 Correct 2 ms 12132 KB Output is correct
70 Correct 2 ms 12132 KB Output is correct
71 Correct 2 ms 12132 KB Output is correct
72 Correct 2 ms 12128 KB Output is correct
73 Correct 2 ms 12132 KB Output is correct
74 Correct 2 ms 12384 KB Output is correct
75 Correct 2 ms 12384 KB Output is correct
76 Correct 2 ms 12388 KB Output is correct
77 Correct 4 ms 12388 KB Output is correct
78 Correct 2 ms 12392 KB Output is correct
79 Correct 2 ms 12380 KB Output is correct
80 Correct 1 ms 10588 KB Output is correct
81 Correct 2 ms 11100 KB Output is correct
82 Correct 1 ms 11356 KB Output is correct
83 Correct 1 ms 11100 KB Output is correct
84 Correct 2 ms 11356 KB Output is correct
85 Correct 1 ms 11356 KB Output is correct
86 Correct 2 ms 10076 KB Output is correct
87 Correct 2 ms 10076 KB Output is correct
88 Correct 2 ms 9820 KB Output is correct
89 Correct 2 ms 9788 KB Output is correct
90 Correct 1 ms 10588 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 9308 KB Output is correct
4 Correct 11 ms 28556 KB Output is correct
5 Correct 9 ms 25180 KB Output is correct
6 Correct 2 ms 13660 KB Output is correct
7 Correct 9 ms 23516 KB Output is correct
8 Correct 8 ms 21460 KB Output is correct
9 Correct 1 ms 14684 KB Output is correct
10 Correct 2 ms 16732 KB Output is correct
11 Correct 2 ms 16732 KB Output is correct
12 Correct 2 ms 12636 KB Output is correct
13 Correct 2 ms 16732 KB Output is correct
14 Correct 2 ms 16860 KB Output is correct
15 Correct 16 ms 33908 KB Output is correct
16 Correct 14 ms 30812 KB Output is correct
17 Correct 11 ms 29464 KB Output is correct
18 Correct 13 ms 35776 KB Output is correct
19 Correct 16 ms 35676 KB Output is correct
20 Correct 14 ms 35800 KB Output is correct
21 Correct 14 ms 33628 KB Output is correct
22 Correct 14 ms 33624 KB Output is correct
23 Correct 14 ms 33628 KB Output is correct
24 Correct 11 ms 31068 KB Output is correct
25 Correct 12 ms 31200 KB Output is correct
26 Correct 14 ms 31068 KB Output is correct
27 Correct 13 ms 31084 KB Output is correct
28 Correct 18 ms 31084 KB Output is correct
29 Correct 14 ms 30832 KB Output is correct
30 Correct 13 ms 34908 KB Output is correct
31 Correct 13 ms 34164 KB Output is correct
32 Correct 16 ms 35160 KB Output is correct
33 Correct 13 ms 33836 KB Output is correct
34 Correct 16 ms 33736 KB Output is correct
35 Correct 13 ms 33868 KB Output is correct
36 Correct 2 ms 16988 KB Output is correct
37 Correct 6 ms 23132 KB Output is correct
38 Correct 5 ms 20572 KB Output is correct
39 Correct 6 ms 22876 KB Output is correct
40 Correct 6 ms 23068 KB Output is correct
41 Correct 5 ms 20572 KB Output is correct
42 Correct 12 ms 28384 KB Output is correct
43 Correct 12 ms 28764 KB Output is correct
44 Correct 16 ms 29528 KB Output is correct
45 Correct 12 ms 29764 KB Output is correct
46 Correct 3 ms 16732 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6748 KB Output is correct
4 Correct 1 ms 11100 KB Output is correct
5 Correct 2 ms 10844 KB Output is correct
6 Correct 1 ms 6492 KB Output is correct
7 Correct 1 ms 10588 KB Output is correct
8 Correct 1 ms 10588 KB Output is correct
9 Correct 1 ms 8540 KB Output is correct
10 Correct 1 ms 10588 KB Output is correct
11 Correct 1 ms 10588 KB Output is correct
12 Correct 1 ms 6492 KB Output is correct
13 Correct 1 ms 10588 KB Output is correct
14 Correct 1 ms 10588 KB Output is correct
15 Correct 1 ms 11100 KB Output is correct
16 Correct 1 ms 9052 KB Output is correct
17 Correct 1 ms 9052 KB Output is correct
18 Correct 1 ms 11356 KB Output is correct
19 Correct 1 ms 11356 KB Output is correct
20 Correct 1 ms 11356 KB Output is correct
21 Correct 1 ms 9308 KB Output is correct
22 Correct 1 ms 9308 KB Output is correct
23 Correct 2 ms 9308 KB Output is correct
24 Correct 1 ms 11100 KB Output is correct
25 Correct 1 ms 11100 KB Output is correct
26 Correct 2 ms 11100 KB Output is correct
27 Correct 1 ms 11100 KB Output is correct
28 Correct 2 ms 11100 KB Output is correct
29 Correct 1 ms 11100 KB Output is correct
30 Correct 2 ms 9048 KB Output is correct
31 Correct 1 ms 11100 KB Output is correct
32 Correct 2 ms 9052 KB Output is correct
33 Correct 2 ms 11100 KB Output is correct
34 Correct 1 ms 11100 KB Output is correct
35 Correct 1 ms 11100 KB Output is correct
36 Correct 1 ms 10588 KB Output is correct
37 Correct 1 ms 8876 KB Output is correct
38 Correct 1 ms 10844 KB Output is correct
39 Correct 1 ms 8796 KB Output is correct
40 Correct 1 ms 10844 KB Output is correct
41 Correct 1 ms 10980 KB Output is correct
42 Correct 2 ms 9052 KB Output is correct
43 Correct 1 ms 9052 KB Output is correct
44 Correct 2 ms 9052 KB Output is correct
45 Correct 1 ms 9308 KB Output is correct
46 Correct 1 ms 8540 KB Output is correct
47 Correct 2 ms 8796 KB Output is correct
48 Correct 1 ms 10588 KB Output is correct
49 Correct 1 ms 10844 KB Output is correct
50 Correct 1 ms 10588 KB Output is correct
51 Correct 1 ms 10844 KB Output is correct
52 Correct 1 ms 10588 KB Output is correct
53 Correct 1 ms 10588 KB Output is correct
54 Correct 1 ms 10588 KB Output is correct
55 Correct 1 ms 10588 KB Output is correct
56 Correct 1 ms 10588 KB Output is correct
57 Correct 1 ms 10588 KB Output is correct
58 Correct 1 ms 10588 KB Output is correct
59 Correct 2 ms 11612 KB Output is correct
60 Correct 2 ms 11612 KB Output is correct
61 Correct 2 ms 11612 KB Output is correct
62 Correct 2 ms 12380 KB Output is correct
63 Correct 3 ms 12380 KB Output is correct
64 Correct 3 ms 12500 KB Output is correct
65 Correct 2 ms 10340 KB Output is correct
66 Correct 2 ms 10336 KB Output is correct
67 Correct 3 ms 10340 KB Output is correct
68 Correct 2 ms 12000 KB Output is correct
69 Correct 2 ms 12132 KB Output is correct
70 Correct 2 ms 12132 KB Output is correct
71 Correct 2 ms 12132 KB Output is correct
72 Correct 2 ms 12128 KB Output is correct
73 Correct 2 ms 12132 KB Output is correct
74 Correct 2 ms 12384 KB Output is correct
75 Correct 2 ms 12384 KB Output is correct
76 Correct 2 ms 12388 KB Output is correct
77 Correct 4 ms 12388 KB Output is correct
78 Correct 2 ms 12392 KB Output is correct
79 Correct 2 ms 12380 KB Output is correct
80 Correct 1 ms 10588 KB Output is correct
81 Correct 2 ms 11100 KB Output is correct
82 Correct 1 ms 11356 KB Output is correct
83 Correct 1 ms 11100 KB Output is correct
84 Correct 2 ms 11356 KB Output is correct
85 Correct 1 ms 11356 KB Output is correct
86 Correct 2 ms 10076 KB Output is correct
87 Correct 2 ms 10076 KB Output is correct
88 Correct 2 ms 9820 KB Output is correct
89 Correct 2 ms 9788 KB Output is correct
90 Correct 1 ms 10588 KB Output is correct
91 Correct 1 ms 9308 KB Output is correct
92 Correct 11 ms 28556 KB Output is correct
93 Correct 9 ms 25180 KB Output is correct
94 Correct 2 ms 13660 KB Output is correct
95 Correct 9 ms 23516 KB Output is correct
96 Correct 8 ms 21460 KB Output is correct
97 Correct 1 ms 14684 KB Output is correct
98 Correct 2 ms 16732 KB Output is correct
99 Correct 2 ms 16732 KB Output is correct
100 Correct 2 ms 12636 KB Output is correct
101 Correct 2 ms 16732 KB Output is correct
102 Correct 2 ms 16860 KB Output is correct
103 Correct 16 ms 33908 KB Output is correct
104 Correct 14 ms 30812 KB Output is correct
105 Correct 11 ms 29464 KB Output is correct
106 Correct 13 ms 35776 KB Output is correct
107 Correct 16 ms 35676 KB Output is correct
108 Correct 14 ms 35800 KB Output is correct
109 Correct 14 ms 33628 KB Output is correct
110 Correct 14 ms 33624 KB Output is correct
111 Correct 14 ms 33628 KB Output is correct
112 Correct 11 ms 31068 KB Output is correct
113 Correct 12 ms 31200 KB Output is correct
114 Correct 14 ms 31068 KB Output is correct
115 Correct 13 ms 31084 KB Output is correct
116 Correct 18 ms 31084 KB Output is correct
117 Correct 14 ms 30832 KB Output is correct
118 Correct 13 ms 34908 KB Output is correct
119 Correct 13 ms 34164 KB Output is correct
120 Correct 16 ms 35160 KB Output is correct
121 Correct 13 ms 33836 KB Output is correct
122 Correct 16 ms 33736 KB Output is correct
123 Correct 13 ms 33868 KB Output is correct
124 Correct 2 ms 16988 KB Output is correct
125 Correct 6 ms 23132 KB Output is correct
126 Correct 5 ms 20572 KB Output is correct
127 Correct 6 ms 22876 KB Output is correct
128 Correct 6 ms 23068 KB Output is correct
129 Correct 5 ms 20572 KB Output is correct
130 Correct 12 ms 28384 KB Output is correct
131 Correct 12 ms 28764 KB Output is correct
132 Correct 16 ms 29528 KB Output is correct
133 Correct 12 ms 29764 KB Output is correct
134 Correct 3 ms 16732 KB Output is correct
135 Correct 2 ms 14940 KB Output is correct
136 Correct 2 ms 19036 KB Output is correct
137 Correct 3 ms 18912 KB Output is correct
138 Correct 2 ms 14812 KB Output is correct
139 Correct 3 ms 19036 KB Output is correct
140 Correct 3 ms 18780 KB Output is correct
141 Correct 2 ms 16732 KB Output is correct
142 Correct 3 ms 18900 KB Output is correct
143 Correct 3 ms 18900 KB Output is correct
144 Correct 1 ms 10584 KB Output is correct
145 Correct 4 ms 18904 KB Output is correct
146 Correct 3 ms 18904 KB Output is correct
147 Correct 19 ms 31820 KB Output is correct
148 Correct 13 ms 34392 KB Output is correct
149 Correct 15 ms 35136 KB Output is correct
150 Correct 22 ms 46020 KB Output is correct
151 Correct 21 ms 46028 KB Output is correct
152 Correct 20 ms 45916 KB Output is correct
153 Correct 19 ms 43940 KB Output is correct
154 Correct 29 ms 43864 KB Output is correct
155 Correct 20 ms 43868 KB Output is correct
156 Correct 19 ms 39256 KB Output is correct
157 Correct 19 ms 39432 KB Output is correct
158 Correct 20 ms 39000 KB Output is correct
159 Correct 20 ms 39240 KB Output is correct
160 Correct 24 ms 39004 KB Output is correct
161 Correct 21 ms 39072 KB Output is correct
162 Correct 18 ms 43608 KB Output is correct
163 Correct 24 ms 43096 KB Output is correct
164 Correct 20 ms 44612 KB Output is correct
165 Correct 17 ms 42332 KB Output is correct
166 Correct 19 ms 44376 KB Output is correct
167 Correct 21 ms 43100 KB Output is correct
168 Correct 4 ms 19036 KB Output is correct
169 Correct 9 ms 27356 KB Output is correct
170 Correct 9 ms 27484 KB Output is correct
171 Correct 7 ms 27224 KB Output is correct
172 Correct 7 ms 26696 KB Output is correct
173 Correct 7 ms 27484 KB Output is correct
174 Correct 18 ms 38488 KB Output is correct
175 Correct 22 ms 43096 KB Output is correct
176 Correct 24 ms 42584 KB Output is correct
177 Correct 14 ms 32800 KB Output is correct
178 Correct 2 ms 18780 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6748 KB Output is correct
4 Correct 1 ms 11100 KB Output is correct
5 Correct 2 ms 10844 KB Output is correct
6 Correct 1 ms 6492 KB Output is correct
7 Correct 1 ms 10588 KB Output is correct
8 Correct 1 ms 10588 KB Output is correct
9 Correct 1 ms 8540 KB Output is correct
10 Correct 1 ms 10588 KB Output is correct
11 Correct 1 ms 10588 KB Output is correct
12 Correct 1 ms 6492 KB Output is correct
13 Correct 1 ms 10588 KB Output is correct
14 Correct 1 ms 10588 KB Output is correct
15 Correct 1 ms 11100 KB Output is correct
16 Correct 1 ms 9052 KB Output is correct
17 Correct 1 ms 9052 KB Output is correct
18 Correct 1 ms 11356 KB Output is correct
19 Correct 1 ms 11356 KB Output is correct
20 Correct 1 ms 11356 KB Output is correct
21 Correct 1 ms 9308 KB Output is correct
22 Correct 1 ms 9308 KB Output is correct
23 Correct 2 ms 9308 KB Output is correct
24 Correct 1 ms 11100 KB Output is correct
25 Correct 1 ms 11100 KB Output is correct
26 Correct 2 ms 11100 KB Output is correct
27 Correct 1 ms 11100 KB Output is correct
28 Correct 2 ms 11100 KB Output is correct
29 Correct 1 ms 11100 KB Output is correct
30 Correct 2 ms 9048 KB Output is correct
31 Correct 1 ms 11100 KB Output is correct
32 Correct 2 ms 9052 KB Output is correct
33 Correct 2 ms 11100 KB Output is correct
34 Correct 1 ms 11100 KB Output is correct
35 Correct 1 ms 11100 KB Output is correct
36 Correct 1 ms 10588 KB Output is correct
37 Correct 1 ms 8876 KB Output is correct
38 Correct 1 ms 10844 KB Output is correct
39 Correct 1 ms 8796 KB Output is correct
40 Correct 1 ms 10844 KB Output is correct
41 Correct 1 ms 10980 KB Output is correct
42 Correct 2 ms 9052 KB Output is correct
43 Correct 1 ms 9052 KB Output is correct
44 Correct 2 ms 9052 KB Output is correct
45 Correct 1 ms 9308 KB Output is correct
46 Correct 1 ms 8540 KB Output is correct
47 Correct 2 ms 8796 KB Output is correct
48 Correct 1 ms 10588 KB Output is correct
49 Correct 1 ms 10844 KB Output is correct
50 Correct 1 ms 10588 KB Output is correct
51 Correct 1 ms 10844 KB Output is correct
52 Correct 1 ms 10588 KB Output is correct
53 Correct 1 ms 10588 KB Output is correct
54 Correct 1 ms 10588 KB Output is correct
55 Correct 1 ms 10588 KB Output is correct
56 Correct 1 ms 10588 KB Output is correct
57 Correct 1 ms 10588 KB Output is correct
58 Correct 1 ms 10588 KB Output is correct
59 Correct 2 ms 11612 KB Output is correct
60 Correct 2 ms 11612 KB Output is correct
61 Correct 2 ms 11612 KB Output is correct
62 Correct 2 ms 12380 KB Output is correct
63 Correct 3 ms 12380 KB Output is correct
64 Correct 3 ms 12500 KB Output is correct
65 Correct 2 ms 10340 KB Output is correct
66 Correct 2 ms 10336 KB Output is correct
67 Correct 3 ms 10340 KB Output is correct
68 Correct 2 ms 12000 KB Output is correct
69 Correct 2 ms 12132 KB Output is correct
70 Correct 2 ms 12132 KB Output is correct
71 Correct 2 ms 12132 KB Output is correct
72 Correct 2 ms 12128 KB Output is correct
73 Correct 2 ms 12132 KB Output is correct
74 Correct 2 ms 12384 KB Output is correct
75 Correct 2 ms 12384 KB Output is correct
76 Correct 2 ms 12388 KB Output is correct
77 Correct 4 ms 12388 KB Output is correct
78 Correct 2 ms 12392 KB Output is correct
79 Correct 2 ms 12380 KB Output is correct
80 Correct 1 ms 10588 KB Output is correct
81 Correct 2 ms 11100 KB Output is correct
82 Correct 1 ms 11356 KB Output is correct
83 Correct 1 ms 11100 KB Output is correct
84 Correct 2 ms 11356 KB Output is correct
85 Correct 1 ms 11356 KB Output is correct
86 Correct 2 ms 10076 KB Output is correct
87 Correct 2 ms 10076 KB Output is correct
88 Correct 2 ms 9820 KB Output is correct
89 Correct 2 ms 9788 KB Output is correct
90 Correct 1 ms 10588 KB Output is correct
91 Correct 1 ms 9308 KB Output is correct
92 Correct 11 ms 28556 KB Output is correct
93 Correct 9 ms 25180 KB Output is correct
94 Correct 2 ms 13660 KB Output is correct
95 Correct 9 ms 23516 KB Output is correct
96 Correct 8 ms 21460 KB Output is correct
97 Correct 1 ms 14684 KB Output is correct
98 Correct 2 ms 16732 KB Output is correct
99 Correct 2 ms 16732 KB Output is correct
100 Correct 2 ms 12636 KB Output is correct
101 Correct 2 ms 16732 KB Output is correct
102 Correct 2 ms 16860 KB Output is correct
103 Correct 16 ms 33908 KB Output is correct
104 Correct 14 ms 30812 KB Output is correct
105 Correct 11 ms 29464 KB Output is correct
106 Correct 13 ms 35776 KB Output is correct
107 Correct 16 ms 35676 KB Output is correct
108 Correct 14 ms 35800 KB Output is correct
109 Correct 14 ms 33628 KB Output is correct
110 Correct 14 ms 33624 KB Output is correct
111 Correct 14 ms 33628 KB Output is correct
112 Correct 11 ms 31068 KB Output is correct
113 Correct 12 ms 31200 KB Output is correct
114 Correct 14 ms 31068 KB Output is correct
115 Correct 13 ms 31084 KB Output is correct
116 Correct 18 ms 31084 KB Output is correct
117 Correct 14 ms 30832 KB Output is correct
118 Correct 13 ms 34908 KB Output is correct
119 Correct 13 ms 34164 KB Output is correct
120 Correct 16 ms 35160 KB Output is correct
121 Correct 13 ms 33836 KB Output is correct
122 Correct 16 ms 33736 KB Output is correct
123 Correct 13 ms 33868 KB Output is correct
124 Correct 2 ms 16988 KB Output is correct
125 Correct 6 ms 23132 KB Output is correct
126 Correct 5 ms 20572 KB Output is correct
127 Correct 6 ms 22876 KB Output is correct
128 Correct 6 ms 23068 KB Output is correct
129 Correct 5 ms 20572 KB Output is correct
130 Correct 12 ms 28384 KB Output is correct
131 Correct 12 ms 28764 KB Output is correct
132 Correct 16 ms 29528 KB Output is correct
133 Correct 12 ms 29764 KB Output is correct
134 Correct 3 ms 16732 KB Output is correct
135 Correct 2 ms 14940 KB Output is correct
136 Correct 2 ms 19036 KB Output is correct
137 Correct 3 ms 18912 KB Output is correct
138 Correct 2 ms 14812 KB Output is correct
139 Correct 3 ms 19036 KB Output is correct
140 Correct 3 ms 18780 KB Output is correct
141 Correct 2 ms 16732 KB Output is correct
142 Correct 3 ms 18900 KB Output is correct
143 Correct 3 ms 18900 KB Output is correct
144 Correct 1 ms 10584 KB Output is correct
145 Correct 4 ms 18904 KB Output is correct
146 Correct 3 ms 18904 KB Output is correct
147 Correct 19 ms 31820 KB Output is correct
148 Correct 13 ms 34392 KB Output is correct
149 Correct 15 ms 35136 KB Output is correct
150 Correct 22 ms 46020 KB Output is correct
151 Correct 21 ms 46028 KB Output is correct
152 Correct 20 ms 45916 KB Output is correct
153 Correct 19 ms 43940 KB Output is correct
154 Correct 29 ms 43864 KB Output is correct
155 Correct 20 ms 43868 KB Output is correct
156 Correct 19 ms 39256 KB Output is correct
157 Correct 19 ms 39432 KB Output is correct
158 Correct 20 ms 39000 KB Output is correct
159 Correct 20 ms 39240 KB Output is correct
160 Correct 24 ms 39004 KB Output is correct
161 Correct 21 ms 39072 KB Output is correct
162 Correct 18 ms 43608 KB Output is correct
163 Correct 24 ms 43096 KB Output is correct
164 Correct 20 ms 44612 KB Output is correct
165 Correct 17 ms 42332 KB Output is correct
166 Correct 19 ms 44376 KB Output is correct
167 Correct 21 ms 43100 KB Output is correct
168 Correct 4 ms 19036 KB Output is correct
169 Correct 9 ms 27356 KB Output is correct
170 Correct 9 ms 27484 KB Output is correct
171 Correct 7 ms 27224 KB Output is correct
172 Correct 7 ms 26696 KB Output is correct
173 Correct 7 ms 27484 KB Output is correct
174 Correct 18 ms 38488 KB Output is correct
175 Correct 22 ms 43096 KB Output is correct
176 Correct 24 ms 42584 KB Output is correct
177 Correct 14 ms 32800 KB Output is correct
178 Correct 2 ms 18780 KB Output is correct
179 Correct 15 ms 36568 KB Output is correct
180 Correct 26 ms 57948 KB Output is correct
181 Correct 32 ms 58076 KB Output is correct
182 Correct 9 ms 35420 KB Output is correct
183 Correct 27 ms 58068 KB Output is correct
184 Correct 24 ms 57948 KB Output is correct
185 Correct 21 ms 49756 KB Output is correct
186 Correct 27 ms 58068 KB Output is correct
187 Correct 29 ms 58060 KB Output is correct
188 Correct 22 ms 43608 KB Output is correct
189 Correct 35 ms 58060 KB Output is correct
190 Correct 37 ms 57940 KB Output is correct
191 Correct 222 ms 258332 KB Output is correct
192 Correct 257 ms 372308 KB Output is correct
193 Correct 246 ms 346836 KB Output is correct
194 Correct 319 ms 518652 KB Output is correct
195 Correct 307 ms 518612 KB Output is correct
196 Correct 306 ms 518480 KB Output is correct
197 Correct 312 ms 516388 KB Output is correct
198 Correct 304 ms 516432 KB Output is correct
199 Correct 310 ms 516476 KB Output is correct
200 Correct 389 ms 406096 KB Output is correct
201 Correct 502 ms 406008 KB Output is correct
202 Correct 542 ms 405544 KB Output is correct
203 Correct 571 ms 405588 KB Output is correct
204 Correct 552 ms 405716 KB Output is correct
205 Correct 547 ms 405544 KB Output is correct
206 Correct 271 ms 456272 KB Output is correct
207 Correct 277 ms 459604 KB Output is correct
208 Correct 246 ms 439084 KB Output is correct
209 Correct 292 ms 464976 KB Output is correct
210 Correct 300 ms 464836 KB Output is correct
211 Correct 291 ms 490836 KB Output is correct
212 Correct 22 ms 54100 KB Output is correct
213 Correct 111 ms 196948 KB Output is correct
214 Correct 108 ms 187472 KB Output is correct
215 Correct 111 ms 199508 KB Output is correct
216 Correct 105 ms 183124 KB Output is correct
217 Correct 108 ms 187472 KB Output is correct
218 Correct 293 ms 468664 KB Output is correct
219 Correct 259 ms 323664 KB Output is correct
220 Correct 296 ms 466100 KB Output is correct
221 Correct 278 ms 442196 KB Output is correct
222 Correct 20 ms 53844 KB Output is correct