# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
969735 |
2024-04-25T14:11:08 Z |
blacktulip |
Wish (LMIO19_noras) |
C++17 |
|
200 ms |
16468 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long lo;
#define fi first
#define se second
#define endl "\n"
#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=1000000000;
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;
}
int 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=1000000000;
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;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
2 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8684 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
2 ms |
8540 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 |
8540 KB |
Output is correct |
11 |
Correct |
2 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
2 ms |
8712 KB |
Output is correct |
15 |
Correct |
3 ms |
8692 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 |
8540 KB |
Output is correct |
19 |
Correct |
2 ms |
8540 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 |
8684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
2 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8684 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
2 ms |
8540 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 |
8540 KB |
Output is correct |
11 |
Correct |
2 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
2 ms |
8712 KB |
Output is correct |
15 |
Correct |
3 ms |
8692 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 |
8540 KB |
Output is correct |
19 |
Correct |
2 ms |
8540 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 |
8684 KB |
Output is correct |
23 |
Correct |
64 ms |
11856 KB |
Output is correct |
24 |
Correct |
64 ms |
11980 KB |
Output is correct |
25 |
Correct |
64 ms |
11984 KB |
Output is correct |
26 |
Correct |
64 ms |
11892 KB |
Output is correct |
27 |
Correct |
63 ms |
11308 KB |
Output is correct |
28 |
Correct |
65 ms |
11504 KB |
Output is correct |
29 |
Correct |
66 ms |
11528 KB |
Output is correct |
30 |
Correct |
68 ms |
11644 KB |
Output is correct |
31 |
Correct |
66 ms |
11660 KB |
Output is correct |
32 |
Correct |
83 ms |
11456 KB |
Output is correct |
33 |
Correct |
89 ms |
11472 KB |
Output is correct |
34 |
Correct |
83 ms |
11456 KB |
Output is correct |
35 |
Correct |
82 ms |
11424 KB |
Output is correct |
36 |
Correct |
83 ms |
11472 KB |
Output is correct |
37 |
Correct |
67 ms |
11280 KB |
Output is correct |
38 |
Correct |
66 ms |
11108 KB |
Output is correct |
39 |
Correct |
72 ms |
10968 KB |
Output is correct |
40 |
Correct |
68 ms |
11112 KB |
Output is correct |
41 |
Correct |
66 ms |
10964 KB |
Output is correct |
42 |
Correct |
66 ms |
11216 KB |
Output is correct |
43 |
Correct |
200 ms |
16464 KB |
Output is correct |
44 |
Correct |
191 ms |
16444 KB |
Output is correct |
45 |
Correct |
173 ms |
16464 KB |
Output is correct |
46 |
Correct |
176 ms |
16444 KB |
Output is correct |
47 |
Correct |
175 ms |
16468 KB |
Output is correct |
48 |
Correct |
173 ms |
14160 KB |
Output is correct |
49 |
Correct |
175 ms |
14256 KB |
Output is correct |
50 |
Correct |
168 ms |
14296 KB |
Output is correct |
51 |
Correct |
175 ms |
14032 KB |
Output is correct |
52 |
Correct |
170 ms |
14028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
2 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8684 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
2 ms |
8540 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 |
8540 KB |
Output is correct |
11 |
Correct |
2 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
2 ms |
8712 KB |
Output is correct |
15 |
Correct |
3 ms |
8692 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 |
8540 KB |
Output is correct |
19 |
Correct |
2 ms |
8540 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 |
8684 KB |
Output is correct |
23 |
Correct |
1 ms |
8540 KB |
Output is correct |
24 |
Correct |
3 ms |
8540 KB |
Output is correct |
25 |
Correct |
2 ms |
8792 KB |
Output is correct |
26 |
Correct |
2 ms |
8540 KB |
Output is correct |
27 |
Correct |
2 ms |
8668 KB |
Output is correct |
28 |
Correct |
2 ms |
8540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
2 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8684 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
2 ms |
8540 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 |
8540 KB |
Output is correct |
11 |
Correct |
2 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
2 ms |
8712 KB |
Output is correct |
15 |
Correct |
3 ms |
8692 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 |
8540 KB |
Output is correct |
19 |
Correct |
2 ms |
8540 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 |
8684 KB |
Output is correct |
23 |
Correct |
64 ms |
11856 KB |
Output is correct |
24 |
Correct |
64 ms |
11980 KB |
Output is correct |
25 |
Correct |
64 ms |
11984 KB |
Output is correct |
26 |
Correct |
64 ms |
11892 KB |
Output is correct |
27 |
Correct |
63 ms |
11308 KB |
Output is correct |
28 |
Correct |
65 ms |
11504 KB |
Output is correct |
29 |
Correct |
66 ms |
11528 KB |
Output is correct |
30 |
Correct |
68 ms |
11644 KB |
Output is correct |
31 |
Correct |
66 ms |
11660 KB |
Output is correct |
32 |
Correct |
83 ms |
11456 KB |
Output is correct |
33 |
Correct |
89 ms |
11472 KB |
Output is correct |
34 |
Correct |
83 ms |
11456 KB |
Output is correct |
35 |
Correct |
82 ms |
11424 KB |
Output is correct |
36 |
Correct |
83 ms |
11472 KB |
Output is correct |
37 |
Correct |
67 ms |
11280 KB |
Output is correct |
38 |
Correct |
66 ms |
11108 KB |
Output is correct |
39 |
Correct |
72 ms |
10968 KB |
Output is correct |
40 |
Correct |
68 ms |
11112 KB |
Output is correct |
41 |
Correct |
66 ms |
10964 KB |
Output is correct |
42 |
Correct |
66 ms |
11216 KB |
Output is correct |
43 |
Correct |
200 ms |
16464 KB |
Output is correct |
44 |
Correct |
191 ms |
16444 KB |
Output is correct |
45 |
Correct |
173 ms |
16464 KB |
Output is correct |
46 |
Correct |
176 ms |
16444 KB |
Output is correct |
47 |
Correct |
175 ms |
16468 KB |
Output is correct |
48 |
Correct |
173 ms |
14160 KB |
Output is correct |
49 |
Correct |
175 ms |
14256 KB |
Output is correct |
50 |
Correct |
168 ms |
14296 KB |
Output is correct |
51 |
Correct |
175 ms |
14032 KB |
Output is correct |
52 |
Correct |
170 ms |
14028 KB |
Output is correct |
53 |
Correct |
1 ms |
8540 KB |
Output is correct |
54 |
Correct |
3 ms |
8540 KB |
Output is correct |
55 |
Correct |
2 ms |
8792 KB |
Output is correct |
56 |
Correct |
2 ms |
8540 KB |
Output is correct |
57 |
Correct |
2 ms |
8668 KB |
Output is correct |
58 |
Correct |
2 ms |
8540 KB |
Output is correct |
59 |
Correct |
67 ms |
11912 KB |
Output is correct |
60 |
Correct |
69 ms |
11204 KB |
Output is correct |
61 |
Correct |
67 ms |
11220 KB |
Output is correct |
62 |
Correct |
80 ms |
11476 KB |
Output is correct |
63 |
Correct |
79 ms |
11376 KB |
Output is correct |
64 |
Correct |
79 ms |
11176 KB |
Output is correct |
65 |
Correct |
77 ms |
11272 KB |
Output is correct |
66 |
Correct |
78 ms |
11464 KB |
Output is correct |
67 |
Correct |
103 ms |
11220 KB |
Output is correct |
68 |
Correct |
92 ms |
11476 KB |
Output is correct |
69 |
Correct |
86 ms |
11400 KB |
Output is correct |
70 |
Correct |
97 ms |
11564 KB |
Output is correct |
71 |
Correct |
85 ms |
11472 KB |
Output is correct |
72 |
Correct |
91 ms |
11532 KB |
Output is correct |
73 |
Correct |
67 ms |
11212 KB |
Output is correct |
74 |
Correct |
74 ms |
11344 KB |
Output is correct |
75 |
Correct |
67 ms |
11476 KB |
Output is correct |
76 |
Correct |
67 ms |
11220 KB |
Output is correct |
77 |
Correct |
169 ms |
16068 KB |
Output is correct |
78 |
Correct |
169 ms |
16044 KB |
Output is correct |
79 |
Correct |
175 ms |
15872 KB |
Output is correct |
80 |
Correct |
185 ms |
15896 KB |
Output is correct |
81 |
Correct |
178 ms |
15952 KB |
Output is correct |
82 |
Correct |
172 ms |
14280 KB |
Output is correct |
83 |
Correct |
180 ms |
14536 KB |
Output is correct |
84 |
Correct |
196 ms |
14500 KB |
Output is correct |
85 |
Correct |
169 ms |
14336 KB |
Output is correct |
86 |
Correct |
178 ms |
14532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
2 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8684 KB |
Output is correct |
4 |
Correct |
2 ms |
8540 KB |
Output is correct |
5 |
Correct |
2 ms |
8540 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 |
8540 KB |
Output is correct |
11 |
Correct |
2 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
2 ms |
8712 KB |
Output is correct |
15 |
Correct |
3 ms |
8692 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 |
8540 KB |
Output is correct |
19 |
Correct |
2 ms |
8540 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 |
8684 KB |
Output is correct |
23 |
Correct |
64 ms |
11856 KB |
Output is correct |
24 |
Correct |
64 ms |
11980 KB |
Output is correct |
25 |
Correct |
64 ms |
11984 KB |
Output is correct |
26 |
Correct |
64 ms |
11892 KB |
Output is correct |
27 |
Correct |
63 ms |
11308 KB |
Output is correct |
28 |
Correct |
65 ms |
11504 KB |
Output is correct |
29 |
Correct |
66 ms |
11528 KB |
Output is correct |
30 |
Correct |
68 ms |
11644 KB |
Output is correct |
31 |
Correct |
66 ms |
11660 KB |
Output is correct |
32 |
Correct |
83 ms |
11456 KB |
Output is correct |
33 |
Correct |
89 ms |
11472 KB |
Output is correct |
34 |
Correct |
83 ms |
11456 KB |
Output is correct |
35 |
Correct |
82 ms |
11424 KB |
Output is correct |
36 |
Correct |
83 ms |
11472 KB |
Output is correct |
37 |
Correct |
67 ms |
11280 KB |
Output is correct |
38 |
Correct |
66 ms |
11108 KB |
Output is correct |
39 |
Correct |
72 ms |
10968 KB |
Output is correct |
40 |
Correct |
68 ms |
11112 KB |
Output is correct |
41 |
Correct |
66 ms |
10964 KB |
Output is correct |
42 |
Correct |
66 ms |
11216 KB |
Output is correct |
43 |
Correct |
200 ms |
16464 KB |
Output is correct |
44 |
Correct |
191 ms |
16444 KB |
Output is correct |
45 |
Correct |
173 ms |
16464 KB |
Output is correct |
46 |
Correct |
176 ms |
16444 KB |
Output is correct |
47 |
Correct |
175 ms |
16468 KB |
Output is correct |
48 |
Correct |
173 ms |
14160 KB |
Output is correct |
49 |
Correct |
175 ms |
14256 KB |
Output is correct |
50 |
Correct |
168 ms |
14296 KB |
Output is correct |
51 |
Correct |
175 ms |
14032 KB |
Output is correct |
52 |
Correct |
170 ms |
14028 KB |
Output is correct |
53 |
Correct |
67 ms |
11912 KB |
Output is correct |
54 |
Correct |
69 ms |
11204 KB |
Output is correct |
55 |
Correct |
67 ms |
11220 KB |
Output is correct |
56 |
Correct |
80 ms |
11476 KB |
Output is correct |
57 |
Correct |
79 ms |
11376 KB |
Output is correct |
58 |
Correct |
79 ms |
11176 KB |
Output is correct |
59 |
Correct |
77 ms |
11272 KB |
Output is correct |
60 |
Correct |
78 ms |
11464 KB |
Output is correct |
61 |
Correct |
103 ms |
11220 KB |
Output is correct |
62 |
Correct |
92 ms |
11476 KB |
Output is correct |
63 |
Correct |
86 ms |
11400 KB |
Output is correct |
64 |
Correct |
97 ms |
11564 KB |
Output is correct |
65 |
Correct |
85 ms |
11472 KB |
Output is correct |
66 |
Correct |
91 ms |
11532 KB |
Output is correct |
67 |
Correct |
67 ms |
11212 KB |
Output is correct |
68 |
Correct |
74 ms |
11344 KB |
Output is correct |
69 |
Correct |
67 ms |
11476 KB |
Output is correct |
70 |
Correct |
67 ms |
11220 KB |
Output is correct |
71 |
Correct |
169 ms |
16068 KB |
Output is correct |
72 |
Correct |
169 ms |
16044 KB |
Output is correct |
73 |
Correct |
175 ms |
15872 KB |
Output is correct |
74 |
Correct |
185 ms |
15896 KB |
Output is correct |
75 |
Correct |
178 ms |
15952 KB |
Output is correct |
76 |
Correct |
172 ms |
14280 KB |
Output is correct |
77 |
Correct |
180 ms |
14536 KB |
Output is correct |
78 |
Correct |
196 ms |
14500 KB |
Output is correct |
79 |
Correct |
169 ms |
14336 KB |
Output is correct |
80 |
Correct |
178 ms |
14532 KB |
Output is correct |
81 |
Correct |
1 ms |
8540 KB |
Output is correct |
82 |
Correct |
3 ms |
8540 KB |
Output is correct |
83 |
Correct |
2 ms |
8792 KB |
Output is correct |
84 |
Correct |
2 ms |
8540 KB |
Output is correct |
85 |
Correct |
2 ms |
8668 KB |
Output is correct |
86 |
Correct |
2 ms |
8540 KB |
Output is correct |
87 |
Incorrect |
74 ms |
12372 KB |
Output isn't correct |
88 |
Halted |
0 ms |
0 KB |
- |