#include <bits/stdc++.h>
using namespace std;
typedef long long lo;
#define fi first
#define se second
#define endl "\n"
#define int long long
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)
#define _ << " " <<
const lo inf = 1000000000;
const lo li = 500005;
const lo mod = 1000000007;
int n,m,a[li],k,flag,t,x[li],y[li],xx[li],yy[li];
int cev;
string s;
vector<pair<int,int>> v;
inline __int128 d(int i,__int128 t){
return (x[i]+(xx[i]-x[i])*t)*(x[i]+(xx[i]-x[i])*t)+(y[i]+(yy[i]-y[i])*t)*(y[i]+(yy[i]-y[i])*t);
}
inline int cp(int i){
int bas=0;
int son=100000000000;
while(bas<son){
if(d(i,ort)<d(i,ort+1))son=ort;
else bas=ort+1;
//~ cout<<bas _ son<<endl;
}
if(d(i,bas)<d(i,son))return bas;
return son;
}
int32_t main(void){
fio();
cin>>n>>k;
FOR{
cin>>x[i]>>y[i]>>xx[i]>>yy[i];
int tut=cp(i);
int bas=tut;
int son=100000000000;
while(bas<=son){
if(d(i,ort)<=k*k)bas=ort+1;
else son=ort-1;
}
int r=son;
bas=0;
son=tut;
while(bas<=son){
if(d(i,ort)<=k*k)son=ort-1;
else bas=ort+1;
}
int l=bas;
if(l<=r)v.pb({l,r});
//~ cout<<i _ l _ r<<endl;
}
sort(v.begin(),v.end());
priority_queue<int> pq;
for(auto go:v){
while(pq.size() && -pq.top()<go.fi)pq.pop();
pq.push(-go.se);
cev=max(cev,(int)pq.size());
}
cout<<cev<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8536 KB |
Output is correct |
5 |
Correct |
2 ms |
8672 KB |
Output is correct |
6 |
Correct |
2 ms |
8540 KB |
Output is correct |
7 |
Correct |
2 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8536 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8792 KB |
Output is correct |
14 |
Correct |
2 ms |
8540 KB |
Output is correct |
15 |
Correct |
2 ms |
8540 KB |
Output is correct |
16 |
Correct |
2 ms |
8540 KB |
Output is correct |
17 |
Correct |
2 ms |
8540 KB |
Output is correct |
18 |
Correct |
2 ms |
8536 KB |
Output is correct |
19 |
Correct |
2 ms |
8536 KB |
Output is correct |
20 |
Correct |
2 ms |
8540 KB |
Output is correct |
21 |
Correct |
2 ms |
8540 KB |
Output is correct |
22 |
Correct |
2 ms |
8540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8536 KB |
Output is correct |
5 |
Correct |
2 ms |
8672 KB |
Output is correct |
6 |
Correct |
2 ms |
8540 KB |
Output is correct |
7 |
Correct |
2 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8536 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8792 KB |
Output is correct |
14 |
Correct |
2 ms |
8540 KB |
Output is correct |
15 |
Correct |
2 ms |
8540 KB |
Output is correct |
16 |
Correct |
2 ms |
8540 KB |
Output is correct |
17 |
Correct |
2 ms |
8540 KB |
Output is correct |
18 |
Correct |
2 ms |
8536 KB |
Output is correct |
19 |
Correct |
2 ms |
8536 KB |
Output is correct |
20 |
Correct |
2 ms |
8540 KB |
Output is correct |
21 |
Correct |
2 ms |
8540 KB |
Output is correct |
22 |
Correct |
2 ms |
8540 KB |
Output is correct |
23 |
Correct |
70 ms |
20168 KB |
Output is correct |
24 |
Correct |
72 ms |
20168 KB |
Output is correct |
25 |
Correct |
72 ms |
20092 KB |
Output is correct |
26 |
Correct |
71 ms |
20304 KB |
Output is correct |
27 |
Correct |
71 ms |
18636 KB |
Output is correct |
28 |
Correct |
83 ms |
19140 KB |
Output is correct |
29 |
Correct |
73 ms |
19144 KB |
Output is correct |
30 |
Correct |
73 ms |
19144 KB |
Output is correct |
31 |
Correct |
73 ms |
19140 KB |
Output is correct |
32 |
Correct |
93 ms |
18800 KB |
Output is correct |
33 |
Correct |
91 ms |
18884 KB |
Output is correct |
34 |
Correct |
95 ms |
18800 KB |
Output is correct |
35 |
Correct |
90 ms |
18888 KB |
Output is correct |
36 |
Correct |
91 ms |
18800 KB |
Output is correct |
37 |
Correct |
78 ms |
18640 KB |
Output is correct |
38 |
Correct |
74 ms |
18608 KB |
Output is correct |
39 |
Correct |
74 ms |
18536 KB |
Output is correct |
40 |
Correct |
75 ms |
18656 KB |
Output is correct |
41 |
Correct |
75 ms |
18412 KB |
Output is correct |
42 |
Correct |
74 ms |
18432 KB |
Output is correct |
43 |
Correct |
198 ms |
24492 KB |
Output is correct |
44 |
Correct |
198 ms |
23996 KB |
Output is correct |
45 |
Correct |
190 ms |
23676 KB |
Output is correct |
46 |
Correct |
192 ms |
23740 KB |
Output is correct |
47 |
Correct |
190 ms |
23740 KB |
Output is correct |
48 |
Correct |
181 ms |
21960 KB |
Output is correct |
49 |
Correct |
180 ms |
21176 KB |
Output is correct |
50 |
Correct |
179 ms |
22476 KB |
Output is correct |
51 |
Correct |
178 ms |
23184 KB |
Output is correct |
52 |
Correct |
182 ms |
21696 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8536 KB |
Output is correct |
5 |
Correct |
2 ms |
8672 KB |
Output is correct |
6 |
Correct |
2 ms |
8540 KB |
Output is correct |
7 |
Correct |
2 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8536 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8792 KB |
Output is correct |
14 |
Correct |
2 ms |
8540 KB |
Output is correct |
15 |
Correct |
2 ms |
8540 KB |
Output is correct |
16 |
Correct |
2 ms |
8540 KB |
Output is correct |
17 |
Correct |
2 ms |
8540 KB |
Output is correct |
18 |
Correct |
2 ms |
8536 KB |
Output is correct |
19 |
Correct |
2 ms |
8536 KB |
Output is correct |
20 |
Correct |
2 ms |
8540 KB |
Output is correct |
21 |
Correct |
2 ms |
8540 KB |
Output is correct |
22 |
Correct |
2 ms |
8540 KB |
Output is correct |
23 |
Correct |
1 ms |
8536 KB |
Output is correct |
24 |
Correct |
2 ms |
8540 KB |
Output is correct |
25 |
Correct |
2 ms |
8536 KB |
Output is correct |
26 |
Correct |
2 ms |
8664 KB |
Output is correct |
27 |
Correct |
2 ms |
8540 KB |
Output is correct |
28 |
Correct |
2 ms |
8536 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8536 KB |
Output is correct |
5 |
Correct |
2 ms |
8672 KB |
Output is correct |
6 |
Correct |
2 ms |
8540 KB |
Output is correct |
7 |
Correct |
2 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8536 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8792 KB |
Output is correct |
14 |
Correct |
2 ms |
8540 KB |
Output is correct |
15 |
Correct |
2 ms |
8540 KB |
Output is correct |
16 |
Correct |
2 ms |
8540 KB |
Output is correct |
17 |
Correct |
2 ms |
8540 KB |
Output is correct |
18 |
Correct |
2 ms |
8536 KB |
Output is correct |
19 |
Correct |
2 ms |
8536 KB |
Output is correct |
20 |
Correct |
2 ms |
8540 KB |
Output is correct |
21 |
Correct |
2 ms |
8540 KB |
Output is correct |
22 |
Correct |
2 ms |
8540 KB |
Output is correct |
23 |
Correct |
70 ms |
20168 KB |
Output is correct |
24 |
Correct |
72 ms |
20168 KB |
Output is correct |
25 |
Correct |
72 ms |
20092 KB |
Output is correct |
26 |
Correct |
71 ms |
20304 KB |
Output is correct |
27 |
Correct |
71 ms |
18636 KB |
Output is correct |
28 |
Correct |
83 ms |
19140 KB |
Output is correct |
29 |
Correct |
73 ms |
19144 KB |
Output is correct |
30 |
Correct |
73 ms |
19144 KB |
Output is correct |
31 |
Correct |
73 ms |
19140 KB |
Output is correct |
32 |
Correct |
93 ms |
18800 KB |
Output is correct |
33 |
Correct |
91 ms |
18884 KB |
Output is correct |
34 |
Correct |
95 ms |
18800 KB |
Output is correct |
35 |
Correct |
90 ms |
18888 KB |
Output is correct |
36 |
Correct |
91 ms |
18800 KB |
Output is correct |
37 |
Correct |
78 ms |
18640 KB |
Output is correct |
38 |
Correct |
74 ms |
18608 KB |
Output is correct |
39 |
Correct |
74 ms |
18536 KB |
Output is correct |
40 |
Correct |
75 ms |
18656 KB |
Output is correct |
41 |
Correct |
75 ms |
18412 KB |
Output is correct |
42 |
Correct |
74 ms |
18432 KB |
Output is correct |
43 |
Correct |
198 ms |
24492 KB |
Output is correct |
44 |
Correct |
198 ms |
23996 KB |
Output is correct |
45 |
Correct |
190 ms |
23676 KB |
Output is correct |
46 |
Correct |
192 ms |
23740 KB |
Output is correct |
47 |
Correct |
190 ms |
23740 KB |
Output is correct |
48 |
Correct |
181 ms |
21960 KB |
Output is correct |
49 |
Correct |
180 ms |
21176 KB |
Output is correct |
50 |
Correct |
179 ms |
22476 KB |
Output is correct |
51 |
Correct |
178 ms |
23184 KB |
Output is correct |
52 |
Correct |
182 ms |
21696 KB |
Output is correct |
53 |
Correct |
1 ms |
8536 KB |
Output is correct |
54 |
Correct |
2 ms |
8540 KB |
Output is correct |
55 |
Correct |
2 ms |
8536 KB |
Output is correct |
56 |
Correct |
2 ms |
8664 KB |
Output is correct |
57 |
Correct |
2 ms |
8540 KB |
Output is correct |
58 |
Correct |
2 ms |
8536 KB |
Output is correct |
59 |
Correct |
72 ms |
20172 KB |
Output is correct |
60 |
Correct |
76 ms |
17848 KB |
Output is correct |
61 |
Correct |
75 ms |
18172 KB |
Output is correct |
62 |
Correct |
76 ms |
18204 KB |
Output is correct |
63 |
Correct |
90 ms |
18024 KB |
Output is correct |
64 |
Correct |
83 ms |
17616 KB |
Output is correct |
65 |
Correct |
84 ms |
17856 KB |
Output is correct |
66 |
Correct |
87 ms |
17996 KB |
Output is correct |
67 |
Correct |
89 ms |
18276 KB |
Output is correct |
68 |
Correct |
100 ms |
18884 KB |
Output is correct |
69 |
Correct |
94 ms |
18548 KB |
Output is correct |
70 |
Correct |
93 ms |
18636 KB |
Output is correct |
71 |
Correct |
93 ms |
18744 KB |
Output is correct |
72 |
Correct |
94 ms |
18628 KB |
Output is correct |
73 |
Correct |
75 ms |
18636 KB |
Output is correct |
74 |
Correct |
76 ms |
19212 KB |
Output is correct |
75 |
Correct |
82 ms |
18884 KB |
Output is correct |
76 |
Correct |
76 ms |
18636 KB |
Output is correct |
77 |
Correct |
190 ms |
23588 KB |
Output is correct |
78 |
Correct |
187 ms |
23612 KB |
Output is correct |
79 |
Correct |
190 ms |
24044 KB |
Output is correct |
80 |
Correct |
186 ms |
22976 KB |
Output is correct |
81 |
Correct |
185 ms |
23488 KB |
Output is correct |
82 |
Correct |
187 ms |
22444 KB |
Output is correct |
83 |
Correct |
205 ms |
21444 KB |
Output is correct |
84 |
Correct |
187 ms |
21700 KB |
Output is correct |
85 |
Correct |
186 ms |
21544 KB |
Output is correct |
86 |
Correct |
188 ms |
22008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8540 KB |
Output is correct |
4 |
Correct |
2 ms |
8536 KB |
Output is correct |
5 |
Correct |
2 ms |
8672 KB |
Output is correct |
6 |
Correct |
2 ms |
8540 KB |
Output is correct |
7 |
Correct |
2 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
1 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8536 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8792 KB |
Output is correct |
14 |
Correct |
2 ms |
8540 KB |
Output is correct |
15 |
Correct |
2 ms |
8540 KB |
Output is correct |
16 |
Correct |
2 ms |
8540 KB |
Output is correct |
17 |
Correct |
2 ms |
8540 KB |
Output is correct |
18 |
Correct |
2 ms |
8536 KB |
Output is correct |
19 |
Correct |
2 ms |
8536 KB |
Output is correct |
20 |
Correct |
2 ms |
8540 KB |
Output is correct |
21 |
Correct |
2 ms |
8540 KB |
Output is correct |
22 |
Correct |
2 ms |
8540 KB |
Output is correct |
23 |
Correct |
70 ms |
20168 KB |
Output is correct |
24 |
Correct |
72 ms |
20168 KB |
Output is correct |
25 |
Correct |
72 ms |
20092 KB |
Output is correct |
26 |
Correct |
71 ms |
20304 KB |
Output is correct |
27 |
Correct |
71 ms |
18636 KB |
Output is correct |
28 |
Correct |
83 ms |
19140 KB |
Output is correct |
29 |
Correct |
73 ms |
19144 KB |
Output is correct |
30 |
Correct |
73 ms |
19144 KB |
Output is correct |
31 |
Correct |
73 ms |
19140 KB |
Output is correct |
32 |
Correct |
93 ms |
18800 KB |
Output is correct |
33 |
Correct |
91 ms |
18884 KB |
Output is correct |
34 |
Correct |
95 ms |
18800 KB |
Output is correct |
35 |
Correct |
90 ms |
18888 KB |
Output is correct |
36 |
Correct |
91 ms |
18800 KB |
Output is correct |
37 |
Correct |
78 ms |
18640 KB |
Output is correct |
38 |
Correct |
74 ms |
18608 KB |
Output is correct |
39 |
Correct |
74 ms |
18536 KB |
Output is correct |
40 |
Correct |
75 ms |
18656 KB |
Output is correct |
41 |
Correct |
75 ms |
18412 KB |
Output is correct |
42 |
Correct |
74 ms |
18432 KB |
Output is correct |
43 |
Correct |
198 ms |
24492 KB |
Output is correct |
44 |
Correct |
198 ms |
23996 KB |
Output is correct |
45 |
Correct |
190 ms |
23676 KB |
Output is correct |
46 |
Correct |
192 ms |
23740 KB |
Output is correct |
47 |
Correct |
190 ms |
23740 KB |
Output is correct |
48 |
Correct |
181 ms |
21960 KB |
Output is correct |
49 |
Correct |
180 ms |
21176 KB |
Output is correct |
50 |
Correct |
179 ms |
22476 KB |
Output is correct |
51 |
Correct |
178 ms |
23184 KB |
Output is correct |
52 |
Correct |
182 ms |
21696 KB |
Output is correct |
53 |
Correct |
72 ms |
20172 KB |
Output is correct |
54 |
Correct |
76 ms |
17848 KB |
Output is correct |
55 |
Correct |
75 ms |
18172 KB |
Output is correct |
56 |
Correct |
76 ms |
18204 KB |
Output is correct |
57 |
Correct |
90 ms |
18024 KB |
Output is correct |
58 |
Correct |
83 ms |
17616 KB |
Output is correct |
59 |
Correct |
84 ms |
17856 KB |
Output is correct |
60 |
Correct |
87 ms |
17996 KB |
Output is correct |
61 |
Correct |
89 ms |
18276 KB |
Output is correct |
62 |
Correct |
100 ms |
18884 KB |
Output is correct |
63 |
Correct |
94 ms |
18548 KB |
Output is correct |
64 |
Correct |
93 ms |
18636 KB |
Output is correct |
65 |
Correct |
93 ms |
18744 KB |
Output is correct |
66 |
Correct |
94 ms |
18628 KB |
Output is correct |
67 |
Correct |
75 ms |
18636 KB |
Output is correct |
68 |
Correct |
76 ms |
19212 KB |
Output is correct |
69 |
Correct |
82 ms |
18884 KB |
Output is correct |
70 |
Correct |
76 ms |
18636 KB |
Output is correct |
71 |
Correct |
190 ms |
23588 KB |
Output is correct |
72 |
Correct |
187 ms |
23612 KB |
Output is correct |
73 |
Correct |
190 ms |
24044 KB |
Output is correct |
74 |
Correct |
186 ms |
22976 KB |
Output is correct |
75 |
Correct |
185 ms |
23488 KB |
Output is correct |
76 |
Correct |
187 ms |
22444 KB |
Output is correct |
77 |
Correct |
205 ms |
21444 KB |
Output is correct |
78 |
Correct |
187 ms |
21700 KB |
Output is correct |
79 |
Correct |
186 ms |
21544 KB |
Output is correct |
80 |
Correct |
188 ms |
22008 KB |
Output is correct |
81 |
Correct |
1 ms |
8536 KB |
Output is correct |
82 |
Correct |
2 ms |
8540 KB |
Output is correct |
83 |
Correct |
2 ms |
8536 KB |
Output is correct |
84 |
Correct |
2 ms |
8664 KB |
Output is correct |
85 |
Correct |
2 ms |
8540 KB |
Output is correct |
86 |
Correct |
2 ms |
8536 KB |
Output is correct |
87 |
Correct |
95 ms |
17868 KB |
Output is correct |
88 |
Correct |
96 ms |
21620 KB |
Output is correct |
89 |
Correct |
103 ms |
21516 KB |
Output is correct |
90 |
Correct |
94 ms |
21504 KB |
Output is correct |
91 |
Correct |
93 ms |
21456 KB |
Output is correct |
92 |
Correct |
98 ms |
21324 KB |
Output is correct |
93 |
Correct |
98 ms |
21452 KB |
Output is correct |
94 |
Correct |
101 ms |
21424 KB |
Output is correct |
95 |
Correct |
101 ms |
21456 KB |
Output is correct |
96 |
Correct |
99 ms |
21456 KB |
Output is correct |
97 |
Correct |
76 ms |
22568 KB |
Output is correct |
98 |
Correct |
77 ms |
22584 KB |
Output is correct |
99 |
Correct |
81 ms |
22608 KB |
Output is correct |
100 |
Correct |
77 ms |
22512 KB |
Output is correct |
101 |
Correct |
85 ms |
22728 KB |
Output is correct |
102 |
Correct |
78 ms |
22452 KB |
Output is correct |
103 |
Correct |
76 ms |
22472 KB |
Output is correct |
104 |
Correct |
77 ms |
22468 KB |
Output is correct |
105 |
Correct |
78 ms |
22512 KB |
Output is correct |
106 |
Correct |
83 ms |
22732 KB |
Output is correct |