#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pt complex<int>
#define pii pair<int, int>
int N, M;
struct Interval{
int x;
int yl, yr;
bool open = false;
bool operator<(const Interval& b)const{
return yl<b.yl;
}
vector<Interval> clip(pii other_pair){
//////cout<<"clipping "<<yl<<" "<<yr<<" "<<other_pair.first<<" "<<other_pair.second<<endl;
if(yr<other_pair.first || other_pair.second<yl){
return {*this};
}
if(yl<=other_pair.first && other_pair.second<=yr){
return {Interval{x, yl, other_pair.first-1, open}, Interval{x, other_pair.second+1, yr, open}};
}
if(other_pair.first<= yl && yr<=other_pair.second){
return {Interval{x, 0, -1, open}};
}
if(other_pair.first<=yl && other_pair.second<=yr){
return {Interval{x, other_pair.second+1, yr, open}};
}
if(other_pair.first>=yl && other_pair.second>=yr){
return {Interval{x, yl, other_pair.first-1, open}};
}
assert(false);
}
bool is_valid(){
return yl<=yr;
}
int len() const{
return yr-yl+1;
}
};
Interval merge_inter(Interval a, Interval b){
return Interval{a.x, a.yl, b.yr, true};
}
struct InterSet{
set<Interval> intervals;
bool is_valid = true;
int nb_unpair= 0;
void insert_small(Interval new_inter){
if((new_inter.len())%2 ==1){
nb_unpair++;
}
intervals.insert(new_inter);
}
std::set<Interval>::iterator erase(std::set<Interval>::iterator it){
if(((*it).len())%2==1){
nb_unpair--;
}
return intervals.erase(it);
}
std::set<Interval>::iterator merge(std::set<Interval>::iterator a, std::set<Interval>::iterator b){
if(a->yr+1 == b->yl){
Interval ia = *a;
Interval ib = *b;
erase(a);
erase(b);
Interval result =merge_inter(ia, ib);
insert_small(result);
return intervals.find(result);
}
return b;
}
void insert(Interval new_inter){
insert_small(new_inter);
auto it = intervals.find(new_inter);
if(it!=intervals.begin()){
auto prev= it;
--prev;
it = merge(prev, it);
}
auto next = it;
next++;
if(next!=intervals.end()){
next = merge(it, next);
}
}
void insert_big(Interval new_inter){
//cout<<"inserting "<<new_inter.yl<<" "<<new_inter.yr<<endl;
/*for(auto e: intervals){
//cout<<e.yl<<" "<<e.yr<<endl;
}*/
auto lb = intervals.upper_bound(new_inter);
if(lb!=intervals.begin()){
--lb;
}
auto rb = intervals.upper_bound(Interval{0, new_inter.yr, new_inter.yr, false});
if(rb!= intervals.end()){
++rb;
}
vector<Interval> to_insert;
for(auto it = lb; it!= rb;){
Interval val = *it;
it = erase(it);
vector<Interval>resulting = val.clip({new_inter.yl, new_inter.yr});
for(auto val2: resulting){
if(!new_inter.open){
if(pii({val.yl, val.yr}) != pii({val2.yl, val2.yr})){
is_valid &= (new_inter.x-val.x)%2==0;
}
}
if(val2.is_valid()){
to_insert.push_back(val2);
}
}
}
for(auto e: to_insert){
insert(e);
}
if(new_inter.open){
insert(new_inter);
}
}
};
signed main(){
cin>>N>>M;
vector<pt> pts;
for(int i = 0; i<N; i++){
int a, b;
cin>>a>>b;
pts.push_back({a, b});
}
vector<pair<pt, pt>> edges;
pt prev= pts.back();
for(int i = 0; i<N; i++){
edges.push_back({prev, pts[i]-prev});
prev = pts[i];
}
int area = 0;
for(auto e: edges){
area += e.first.imag() * e.second.real();
}
if(area<0){
for(pair<pt, pt>&edge : edges){
edge = {edge.first+edge.second, -edge.second};
}
}
vector<Interval> inters;
for(auto e: edges){
if(e.second.imag()!=0){
if(e.second.imag()>0){
inters.push_back(Interval{e.first.real(), e.first.imag(), e.first.imag()+e.second.imag()-1, true});
}
else if(e.second.imag()<0){
inters.push_back(Interval{e.first.real(), e.first.imag()+e.second.imag(), e.first.imag()-1, false});
}
}
}
auto cmp = [&](Interval& a, Interval& b){
return a.x<b.x;
};
sort(inters.begin(), inters.end(), cmp);
vector<InterSet> inter_set(2);
int k = 0;
Interval prev_inter = Interval{0, 0, 0, true};
auto chmax = [&](int x){
if(inter_set[(x+1)%2].intervals.size()==0){
if(inter_set[0].is_valid && inter_set[1].is_valid){
k = max(x, k);
}
}
else if(inter_set[x%2].intervals.size()==0){
if(inter_set[0].is_valid && inter_set[1].is_valid){
k = max(x-1, k);
}
}
};
for(auto e: inters){
if(e.x!=prev_inter.x){
//cout<<"nb_unpair: "<<inter_set[0].nb_unpair<<" "<<inter_set[1].nb_unpair<<endl;
for(int i= 0; i<2; i++){
inter_set[i].is_valid &= (inter_set[i].nb_unpair ==0);
}
chmax(e.x);
}
if(e.open){
inter_set[e.x%2].insert_big(e);
}
else{
inter_set[0].insert_big(e);
inter_set[1].insert_big(e);
}
prev_inter = e;
}
chmax(M);
cout<<k<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
508 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
20 ms |
3708 KB |
Output is correct |
3 |
Correct |
118 ms |
17460 KB |
Output is correct |
4 |
Correct |
56 ms |
8508 KB |
Output is correct |
5 |
Correct |
55 ms |
9208 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
118 ms |
17536 KB |
Output is correct |
9 |
Correct |
74 ms |
10052 KB |
Output is correct |
10 |
Correct |
120 ms |
17972 KB |
Output is correct |
11 |
Correct |
56 ms |
8512 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
111 ms |
20304 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
103 ms |
19256 KB |
Output is correct |
6 |
Correct |
105 ms |
17564 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
4 ms |
1116 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
96 ms |
19760 KB |
Output is correct |
18 |
Correct |
99 ms |
17912 KB |
Output is correct |
19 |
Correct |
3 ms |
1116 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
604 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
344 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
344 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
101 ms |
18652 KB |
Output is correct |
50 |
Correct |
103 ms |
17468 KB |
Output is correct |
51 |
Correct |
115 ms |
16956 KB |
Output is correct |
52 |
Correct |
100 ms |
19432 KB |
Output is correct |
53 |
Correct |
0 ms |
344 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
4 ms |
1100 KB |
Output is correct |
56 |
Correct |
4 ms |
1116 KB |
Output is correct |
57 |
Correct |
1 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
348 KB |
Output is correct |
63 |
Correct |
6 ms |
1624 KB |
Output is correct |
64 |
Correct |
4 ms |
1116 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
0 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
1 ms |
348 KB |
Output is correct |
70 |
Correct |
0 ms |
344 KB |
Output is correct |
71 |
Correct |
1 ms |
604 KB |
Output is correct |
72 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
61 ms |
9116 KB |
Output is correct |
3 |
Correct |
60 ms |
8660 KB |
Output is correct |
4 |
Correct |
101 ms |
17464 KB |
Output is correct |
5 |
Correct |
102 ms |
17208 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
157 ms |
17904 KB |
Output is correct |
9 |
Correct |
161 ms |
19480 KB |
Output is correct |
10 |
Correct |
165 ms |
17552 KB |
Output is correct |
11 |
Correct |
163 ms |
19780 KB |
Output is correct |
12 |
Correct |
154 ms |
17204 KB |
Output is correct |
13 |
Correct |
194 ms |
19164 KB |
Output is correct |
14 |
Correct |
122 ms |
17720 KB |
Output is correct |
15 |
Correct |
129 ms |
19820 KB |
Output is correct |
16 |
Correct |
167 ms |
17376 KB |
Output is correct |
17 |
Correct |
180 ms |
17716 KB |
Output is correct |
18 |
Correct |
237 ms |
17068 KB |
Output is correct |
19 |
Correct |
184 ms |
16952 KB |
Output is correct |
20 |
Correct |
166 ms |
16952 KB |
Output is correct |
21 |
Correct |
160 ms |
17716 KB |
Output is correct |
22 |
Correct |
190 ms |
18488 KB |
Output is correct |
23 |
Correct |
141 ms |
17716 KB |
Output is correct |
24 |
Correct |
186 ms |
17984 KB |
Output is correct |
25 |
Correct |
144 ms |
17464 KB |
Output is correct |
26 |
Correct |
192 ms |
23352 KB |
Output is correct |
27 |
Correct |
156 ms |
22576 KB |
Output is correct |
28 |
Correct |
158 ms |
23092 KB |
Output is correct |
29 |
Correct |
130 ms |
20764 KB |
Output is correct |
30 |
Correct |
162 ms |
19704 KB |
Output is correct |
31 |
Correct |
141 ms |
17976 KB |
Output is correct |
32 |
Correct |
170 ms |
20040 KB |
Output is correct |
33 |
Correct |
128 ms |
17976 KB |
Output is correct |
34 |
Correct |
56 ms |
8792 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
344 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
344 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
217 ms |
19076 KB |
Output is correct |
50 |
Correct |
0 ms |
344 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
84 ms |
17464 KB |
Output is correct |
53 |
Correct |
118 ms |
18744 KB |
Output is correct |
54 |
Correct |
101 ms |
18444 KB |
Output is correct |
55 |
Correct |
106 ms |
19764 KB |
Output is correct |
56 |
Correct |
126 ms |
17212 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
119 ms |
17552 KB |
Output is correct |
2 |
Correct |
60 ms |
8700 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
117 ms |
19276 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
132 ms |
17256 KB |
Output is correct |
7 |
Correct |
2 ms |
604 KB |
Output is correct |
8 |
Correct |
185 ms |
20416 KB |
Output is correct |
9 |
Correct |
160 ms |
17484 KB |
Output is correct |
10 |
Correct |
126 ms |
18488 KB |
Output is correct |
11 |
Correct |
124 ms |
18996 KB |
Output is correct |
12 |
Correct |
126 ms |
16948 KB |
Output is correct |
13 |
Correct |
155 ms |
19484 KB |
Output is correct |
14 |
Correct |
160 ms |
16952 KB |
Output is correct |
15 |
Correct |
158 ms |
17380 KB |
Output is correct |
16 |
Correct |
142 ms |
19356 KB |
Output is correct |
17 |
Correct |
139 ms |
17708 KB |
Output is correct |
18 |
Correct |
140 ms |
17972 KB |
Output is correct |
19 |
Correct |
60 ms |
8764 KB |
Output is correct |
20 |
Correct |
1 ms |
344 KB |
Output is correct |
21 |
Correct |
114 ms |
17496 KB |
Output is correct |
22 |
Correct |
64 ms |
9908 KB |
Output is correct |
23 |
Correct |
1 ms |
600 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
344 KB |
Output is correct |
27 |
Correct |
0 ms |
344 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
81 ms |
8768 KB |
Output is correct |
37 |
Correct |
97 ms |
17464 KB |
Output is correct |
38 |
Correct |
95 ms |
17720 KB |
Output is correct |
39 |
Correct |
115 ms |
19516 KB |
Output is correct |
40 |
Correct |
102 ms |
17460 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
344 KB |
Output is correct |
43 |
Correct |
1 ms |
344 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
500 KB |
Output is correct |
46 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
508 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
20 ms |
3708 KB |
Output is correct |
34 |
Correct |
118 ms |
17460 KB |
Output is correct |
35 |
Correct |
56 ms |
8508 KB |
Output is correct |
36 |
Correct |
55 ms |
9208 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
1 ms |
348 KB |
Output is correct |
39 |
Correct |
118 ms |
17536 KB |
Output is correct |
40 |
Correct |
74 ms |
10052 KB |
Output is correct |
41 |
Correct |
120 ms |
17972 KB |
Output is correct |
42 |
Correct |
56 ms |
8512 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
111 ms |
20304 KB |
Output is correct |
45 |
Correct |
0 ms |
344 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
1 ms |
344 KB |
Output is correct |
48 |
Correct |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
1 ms |
348 KB |
Output is correct |
52 |
Correct |
1 ms |
344 KB |
Output is correct |
53 |
Correct |
103 ms |
19256 KB |
Output is correct |
54 |
Correct |
105 ms |
17564 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
348 KB |
Output is correct |
58 |
Correct |
4 ms |
1116 KB |
Output is correct |
59 |
Correct |
1 ms |
344 KB |
Output is correct |
60 |
Correct |
1 ms |
348 KB |
Output is correct |
61 |
Correct |
1 ms |
344 KB |
Output is correct |
62 |
Correct |
1 ms |
344 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
96 ms |
19760 KB |
Output is correct |
66 |
Correct |
99 ms |
17912 KB |
Output is correct |
67 |
Correct |
3 ms |
1116 KB |
Output is correct |
68 |
Correct |
1 ms |
348 KB |
Output is correct |
69 |
Correct |
1 ms |
348 KB |
Output is correct |
70 |
Correct |
1 ms |
348 KB |
Output is correct |
71 |
Correct |
1 ms |
604 KB |
Output is correct |
72 |
Correct |
1 ms |
348 KB |
Output is correct |
73 |
Correct |
0 ms |
348 KB |
Output is correct |
74 |
Correct |
0 ms |
348 KB |
Output is correct |
75 |
Correct |
0 ms |
348 KB |
Output is correct |
76 |
Correct |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
0 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
0 ms |
348 KB |
Output is correct |
81 |
Correct |
0 ms |
348 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
344 KB |
Output is correct |
85 |
Correct |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
0 ms |
348 KB |
Output is correct |
87 |
Correct |
0 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
348 KB |
Output is correct |
89 |
Correct |
0 ms |
348 KB |
Output is correct |
90 |
Correct |
0 ms |
348 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
0 ms |
348 KB |
Output is correct |
93 |
Correct |
0 ms |
348 KB |
Output is correct |
94 |
Correct |
0 ms |
348 KB |
Output is correct |
95 |
Correct |
0 ms |
344 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
101 ms |
18652 KB |
Output is correct |
98 |
Correct |
103 ms |
17468 KB |
Output is correct |
99 |
Correct |
115 ms |
16956 KB |
Output is correct |
100 |
Correct |
100 ms |
19432 KB |
Output is correct |
101 |
Correct |
0 ms |
344 KB |
Output is correct |
102 |
Correct |
0 ms |
348 KB |
Output is correct |
103 |
Correct |
4 ms |
1100 KB |
Output is correct |
104 |
Correct |
4 ms |
1116 KB |
Output is correct |
105 |
Correct |
1 ms |
348 KB |
Output is correct |
106 |
Correct |
0 ms |
348 KB |
Output is correct |
107 |
Correct |
0 ms |
348 KB |
Output is correct |
108 |
Correct |
0 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
348 KB |
Output is correct |
110 |
Correct |
0 ms |
348 KB |
Output is correct |
111 |
Correct |
6 ms |
1624 KB |
Output is correct |
112 |
Correct |
4 ms |
1116 KB |
Output is correct |
113 |
Correct |
0 ms |
348 KB |
Output is correct |
114 |
Correct |
1 ms |
348 KB |
Output is correct |
115 |
Correct |
0 ms |
348 KB |
Output is correct |
116 |
Correct |
0 ms |
348 KB |
Output is correct |
117 |
Correct |
1 ms |
348 KB |
Output is correct |
118 |
Correct |
0 ms |
344 KB |
Output is correct |
119 |
Correct |
1 ms |
604 KB |
Output is correct |
120 |
Correct |
0 ms |
348 KB |
Output is correct |
121 |
Correct |
0 ms |
348 KB |
Output is correct |
122 |
Correct |
61 ms |
9116 KB |
Output is correct |
123 |
Correct |
60 ms |
8660 KB |
Output is correct |
124 |
Correct |
101 ms |
17464 KB |
Output is correct |
125 |
Correct |
102 ms |
17208 KB |
Output is correct |
126 |
Correct |
1 ms |
344 KB |
Output is correct |
127 |
Correct |
0 ms |
348 KB |
Output is correct |
128 |
Correct |
157 ms |
17904 KB |
Output is correct |
129 |
Correct |
161 ms |
19480 KB |
Output is correct |
130 |
Correct |
165 ms |
17552 KB |
Output is correct |
131 |
Correct |
163 ms |
19780 KB |
Output is correct |
132 |
Correct |
154 ms |
17204 KB |
Output is correct |
133 |
Correct |
194 ms |
19164 KB |
Output is correct |
134 |
Correct |
122 ms |
17720 KB |
Output is correct |
135 |
Correct |
129 ms |
19820 KB |
Output is correct |
136 |
Correct |
167 ms |
17376 KB |
Output is correct |
137 |
Correct |
180 ms |
17716 KB |
Output is correct |
138 |
Correct |
237 ms |
17068 KB |
Output is correct |
139 |
Correct |
184 ms |
16952 KB |
Output is correct |
140 |
Correct |
166 ms |
16952 KB |
Output is correct |
141 |
Correct |
160 ms |
17716 KB |
Output is correct |
142 |
Correct |
190 ms |
18488 KB |
Output is correct |
143 |
Correct |
141 ms |
17716 KB |
Output is correct |
144 |
Correct |
186 ms |
17984 KB |
Output is correct |
145 |
Correct |
144 ms |
17464 KB |
Output is correct |
146 |
Correct |
192 ms |
23352 KB |
Output is correct |
147 |
Correct |
156 ms |
22576 KB |
Output is correct |
148 |
Correct |
158 ms |
23092 KB |
Output is correct |
149 |
Correct |
130 ms |
20764 KB |
Output is correct |
150 |
Correct |
162 ms |
19704 KB |
Output is correct |
151 |
Correct |
141 ms |
17976 KB |
Output is correct |
152 |
Correct |
170 ms |
20040 KB |
Output is correct |
153 |
Correct |
128 ms |
17976 KB |
Output is correct |
154 |
Correct |
56 ms |
8792 KB |
Output is correct |
155 |
Correct |
1 ms |
348 KB |
Output is correct |
156 |
Correct |
0 ms |
348 KB |
Output is correct |
157 |
Correct |
0 ms |
348 KB |
Output is correct |
158 |
Correct |
0 ms |
344 KB |
Output is correct |
159 |
Correct |
0 ms |
344 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Correct |
0 ms |
348 KB |
Output is correct |
162 |
Correct |
0 ms |
348 KB |
Output is correct |
163 |
Correct |
0 ms |
348 KB |
Output is correct |
164 |
Correct |
0 ms |
348 KB |
Output is correct |
165 |
Correct |
0 ms |
344 KB |
Output is correct |
166 |
Correct |
0 ms |
348 KB |
Output is correct |
167 |
Correct |
0 ms |
348 KB |
Output is correct |
168 |
Correct |
0 ms |
348 KB |
Output is correct |
169 |
Correct |
217 ms |
19076 KB |
Output is correct |
170 |
Correct |
0 ms |
344 KB |
Output is correct |
171 |
Correct |
0 ms |
348 KB |
Output is correct |
172 |
Correct |
84 ms |
17464 KB |
Output is correct |
173 |
Correct |
118 ms |
18744 KB |
Output is correct |
174 |
Correct |
101 ms |
18444 KB |
Output is correct |
175 |
Correct |
106 ms |
19764 KB |
Output is correct |
176 |
Correct |
126 ms |
17212 KB |
Output is correct |
177 |
Correct |
0 ms |
348 KB |
Output is correct |
178 |
Correct |
0 ms |
348 KB |
Output is correct |
179 |
Correct |
0 ms |
348 KB |
Output is correct |
180 |
Correct |
119 ms |
17552 KB |
Output is correct |
181 |
Correct |
60 ms |
8700 KB |
Output is correct |
182 |
Correct |
1 ms |
348 KB |
Output is correct |
183 |
Correct |
117 ms |
19276 KB |
Output is correct |
184 |
Correct |
0 ms |
344 KB |
Output is correct |
185 |
Correct |
132 ms |
17256 KB |
Output is correct |
186 |
Correct |
2 ms |
604 KB |
Output is correct |
187 |
Correct |
185 ms |
20416 KB |
Output is correct |
188 |
Correct |
160 ms |
17484 KB |
Output is correct |
189 |
Correct |
126 ms |
18488 KB |
Output is correct |
190 |
Correct |
124 ms |
18996 KB |
Output is correct |
191 |
Correct |
126 ms |
16948 KB |
Output is correct |
192 |
Correct |
155 ms |
19484 KB |
Output is correct |
193 |
Correct |
160 ms |
16952 KB |
Output is correct |
194 |
Correct |
158 ms |
17380 KB |
Output is correct |
195 |
Correct |
142 ms |
19356 KB |
Output is correct |
196 |
Correct |
139 ms |
17708 KB |
Output is correct |
197 |
Correct |
140 ms |
17972 KB |
Output is correct |
198 |
Correct |
60 ms |
8764 KB |
Output is correct |
199 |
Correct |
1 ms |
344 KB |
Output is correct |
200 |
Correct |
114 ms |
17496 KB |
Output is correct |
201 |
Correct |
64 ms |
9908 KB |
Output is correct |
202 |
Correct |
1 ms |
600 KB |
Output is correct |
203 |
Correct |
0 ms |
348 KB |
Output is correct |
204 |
Correct |
0 ms |
348 KB |
Output is correct |
205 |
Correct |
1 ms |
344 KB |
Output is correct |
206 |
Correct |
0 ms |
344 KB |
Output is correct |
207 |
Correct |
0 ms |
348 KB |
Output is correct |
208 |
Correct |
0 ms |
348 KB |
Output is correct |
209 |
Correct |
0 ms |
348 KB |
Output is correct |
210 |
Correct |
0 ms |
348 KB |
Output is correct |
211 |
Correct |
0 ms |
348 KB |
Output is correct |
212 |
Correct |
0 ms |
348 KB |
Output is correct |
213 |
Correct |
0 ms |
348 KB |
Output is correct |
214 |
Correct |
0 ms |
348 KB |
Output is correct |
215 |
Correct |
81 ms |
8768 KB |
Output is correct |
216 |
Correct |
97 ms |
17464 KB |
Output is correct |
217 |
Correct |
95 ms |
17720 KB |
Output is correct |
218 |
Correct |
115 ms |
19516 KB |
Output is correct |
219 |
Correct |
102 ms |
17460 KB |
Output is correct |
220 |
Correct |
0 ms |
348 KB |
Output is correct |
221 |
Correct |
0 ms |
344 KB |
Output is correct |
222 |
Correct |
1 ms |
344 KB |
Output is correct |
223 |
Correct |
0 ms |
348 KB |
Output is correct |
224 |
Correct |
1 ms |
500 KB |
Output is correct |
225 |
Correct |
1 ms |
348 KB |
Output is correct |
226 |
Correct |
160 ms |
22856 KB |
Output is correct |
227 |
Correct |
143 ms |
23348 KB |
Output is correct |
228 |
Correct |
124 ms |
22328 KB |
Output is correct |
229 |
Correct |
144 ms |
21024 KB |
Output is correct |
230 |
Correct |
223 ms |
21776 KB |
Output is correct |
231 |
Correct |
123 ms |
20788 KB |
Output is correct |
232 |
Correct |
155 ms |
21248 KB |
Output is correct |
233 |
Correct |
64 ms |
11584 KB |
Output is correct |
234 |
Correct |
119 ms |
22584 KB |
Output is correct |
235 |
Correct |
124 ms |
22820 KB |
Output is correct |
236 |
Correct |
219 ms |
22832 KB |
Output is correct |
237 |
Correct |
140 ms |
21300 KB |
Output is correct |
238 |
Correct |
91 ms |
19472 KB |
Output is correct |
239 |
Correct |
214 ms |
21024 KB |
Output is correct |
240 |
Correct |
129 ms |
22388 KB |
Output is correct |
241 |
Correct |
127 ms |
23192 KB |
Output is correct |
242 |
Correct |
70 ms |
10560 KB |
Output is correct |