# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
638878 |
2022-09-07T18:59:45 Z |
endy |
Wish (LMIO19_noras) |
C++17 |
|
1000 ms |
5412 KB |
#include <bits/stdc++.h>
using namespace std;
constexpr long long MAXN=2e5+10;
constexpr long long INF = 1e12;
long long n, r, ans=0, dia[10*MAXN];
vector <long long> coord[5];
int main(){
ios::sync_with_stdio(false); cin.tie(0);
cin >> n >> r;
for(int i=0 ; i<n ; i++){
long long a, b, c, d;
cin >> a >> b >> c >> d;
coord[0].push_back(a);
coord[1].push_back(b);
coord[2].push_back(c);
coord[3].push_back(d);
}
for(int i=0 ; i<n ; i++){
long long a = coord[0][i], b = coord[1][i], c = coord[2][i], d = coord[3][i];
long long x = c-a, y = d-b, cont=1;
long long pdist=INF, blablabla=0;
while(blablabla==0){
long long A = a*a, B = b*b, R = r*r;
long long dist = A+B;
if(dist < 0) dist = (-1)*dist;
//cout << dist << " - dist " << A << " a ao quadrado " << B << " b ao quadrado" << endl;
if(dist <= (r*r)){
dia[cont]++;
ans = max(ans, dia[cont]);
}else if(pdist < dist){
blablabla = 1;
}
cont++;
a+=x;
b+=y;
pdist=dist;
}
//cout << ans << endl;
}
cout << ans << endl;
return 0;
}
Compilation message
noras.cpp: In function 'int main()':
noras.cpp:36:32: warning: unused variable 'R' [-Wunused-variable]
36 | long long A = a*a, B = b*b, R = r*r;
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
2 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
17 ms |
340 KB |
Output is correct |
15 |
Correct |
14 ms |
340 KB |
Output is correct |
16 |
Correct |
17 ms |
412 KB |
Output is correct |
17 |
Correct |
17 ms |
340 KB |
Output is correct |
18 |
Correct |
14 ms |
340 KB |
Output is correct |
19 |
Correct |
4 ms |
340 KB |
Output is correct |
20 |
Correct |
4 ms |
348 KB |
Output is correct |
21 |
Correct |
5 ms |
340 KB |
Output is correct |
22 |
Correct |
5 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
2 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
17 ms |
340 KB |
Output is correct |
15 |
Correct |
14 ms |
340 KB |
Output is correct |
16 |
Correct |
17 ms |
412 KB |
Output is correct |
17 |
Correct |
17 ms |
340 KB |
Output is correct |
18 |
Correct |
14 ms |
340 KB |
Output is correct |
19 |
Correct |
4 ms |
340 KB |
Output is correct |
20 |
Correct |
4 ms |
348 KB |
Output is correct |
21 |
Correct |
5 ms |
340 KB |
Output is correct |
22 |
Correct |
5 ms |
340 KB |
Output is correct |
23 |
Correct |
34 ms |
5084 KB |
Output is correct |
24 |
Correct |
31 ms |
5096 KB |
Output is correct |
25 |
Correct |
31 ms |
5092 KB |
Output is correct |
26 |
Correct |
32 ms |
5124 KB |
Output is correct |
27 |
Correct |
33 ms |
5412 KB |
Output is correct |
28 |
Correct |
30 ms |
5300 KB |
Output is correct |
29 |
Correct |
41 ms |
5308 KB |
Output is correct |
30 |
Correct |
31 ms |
5260 KB |
Output is correct |
31 |
Correct |
31 ms |
5284 KB |
Output is correct |
32 |
Execution timed out |
1078 ms |
5360 KB |
Time limit exceeded |
33 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
2 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
17 ms |
340 KB |
Output is correct |
15 |
Correct |
14 ms |
340 KB |
Output is correct |
16 |
Correct |
17 ms |
412 KB |
Output is correct |
17 |
Correct |
17 ms |
340 KB |
Output is correct |
18 |
Correct |
14 ms |
340 KB |
Output is correct |
19 |
Correct |
4 ms |
340 KB |
Output is correct |
20 |
Correct |
4 ms |
348 KB |
Output is correct |
21 |
Correct |
5 ms |
340 KB |
Output is correct |
22 |
Correct |
5 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
212 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
12 ms |
340 KB |
Output is correct |
26 |
Correct |
3 ms |
344 KB |
Output is correct |
27 |
Correct |
4 ms |
344 KB |
Output is correct |
28 |
Correct |
4 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
2 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
17 ms |
340 KB |
Output is correct |
15 |
Correct |
14 ms |
340 KB |
Output is correct |
16 |
Correct |
17 ms |
412 KB |
Output is correct |
17 |
Correct |
17 ms |
340 KB |
Output is correct |
18 |
Correct |
14 ms |
340 KB |
Output is correct |
19 |
Correct |
4 ms |
340 KB |
Output is correct |
20 |
Correct |
4 ms |
348 KB |
Output is correct |
21 |
Correct |
5 ms |
340 KB |
Output is correct |
22 |
Correct |
5 ms |
340 KB |
Output is correct |
23 |
Correct |
34 ms |
5084 KB |
Output is correct |
24 |
Correct |
31 ms |
5096 KB |
Output is correct |
25 |
Correct |
31 ms |
5092 KB |
Output is correct |
26 |
Correct |
32 ms |
5124 KB |
Output is correct |
27 |
Correct |
33 ms |
5412 KB |
Output is correct |
28 |
Correct |
30 ms |
5300 KB |
Output is correct |
29 |
Correct |
41 ms |
5308 KB |
Output is correct |
30 |
Correct |
31 ms |
5260 KB |
Output is correct |
31 |
Correct |
31 ms |
5284 KB |
Output is correct |
32 |
Execution timed out |
1078 ms |
5360 KB |
Time limit exceeded |
33 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
2 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
17 ms |
340 KB |
Output is correct |
15 |
Correct |
14 ms |
340 KB |
Output is correct |
16 |
Correct |
17 ms |
412 KB |
Output is correct |
17 |
Correct |
17 ms |
340 KB |
Output is correct |
18 |
Correct |
14 ms |
340 KB |
Output is correct |
19 |
Correct |
4 ms |
340 KB |
Output is correct |
20 |
Correct |
4 ms |
348 KB |
Output is correct |
21 |
Correct |
5 ms |
340 KB |
Output is correct |
22 |
Correct |
5 ms |
340 KB |
Output is correct |
23 |
Correct |
34 ms |
5084 KB |
Output is correct |
24 |
Correct |
31 ms |
5096 KB |
Output is correct |
25 |
Correct |
31 ms |
5092 KB |
Output is correct |
26 |
Correct |
32 ms |
5124 KB |
Output is correct |
27 |
Correct |
33 ms |
5412 KB |
Output is correct |
28 |
Correct |
30 ms |
5300 KB |
Output is correct |
29 |
Correct |
41 ms |
5308 KB |
Output is correct |
30 |
Correct |
31 ms |
5260 KB |
Output is correct |
31 |
Correct |
31 ms |
5284 KB |
Output is correct |
32 |
Execution timed out |
1078 ms |
5360 KB |
Time limit exceeded |
33 |
Halted |
0 ms |
0 KB |
- |