ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#185182 | #2756. 兔子抓狼 | tkswls | 100 | 1668ms | 16892kb | C++11 | 617b | 2023-09-24 09:58:59 | 2023-09-24 12:02:24 |
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n, t;
struct node {
int x, y;
long double dis;
} b[500005];
bool cmp(node p, node q) {
return p.dis < q.dis;
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> t;
for (int i = 1; i <= n; i++) {
cin >> b[i].x >> b[i].y;
b[i].dis = sqrt((10000000 - b[i].x) * (10000000 - b[i].x) + b[i].y * b[i].y);
}
sort(b + 1, b + n + 1, cmp);
long long ans = 0;
for (int i = 1; i <= n; i++) {
if (b[i].dis <= ans * t + 10000000) {
ans++;
} else {
break;
}
}
cout << ans;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1248kb
input:
1 0 3397207 6388392
output:
1
result:
ok single line: '1'
Test #2:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
1 0 2679279 -1344373
output:
1
result:
ok single line: '1'
Test #3:
score: 10
Accepted
time: 204ms
memory: 16892kb
input:
500000 0 8471505 -6326291 10788878 8737969 3351532 1897516 1403680 -233153 12636871 1246248 18100435...
output:
476349
result:
ok single line: '476349'
Test #4:
score: 10
Accepted
time: 209ms
memory: 16892kb
input:
500000 0 7441739 5853841 11544686 3514854 11336539 -5996122 8433392 -5095732 6081015 -7332291 643085...
output:
476375
result:
ok single line: '476375'
Test #5:
score: 10
Accepted
time: 195ms
memory: 16892kb
input:
500000 24 16091253 -4872181 18656204 2680986 14707406 -3518171 17153405 3563871 12890379 1612135 187...
output:
10441
result:
ok single line: '10441'
Test #6:
score: 10
Accepted
time: 207ms
memory: 16892kb
input:
500000 168 18569140 -3518474 15777516 1736149 17560051 501909 15235439 -8056987 13084029 -1624084 10...
output:
14885
result:
ok single line: '14885'
Test #7:
score: 10
Accepted
time: 209ms
memory: 16888kb
input:
500000 104 13110797 5397737 16961793 1660107 12525824 -403106 14379422 2847808 12226373 -9482183 140...
output:
12465
result:
ok single line: '12465'
Test #8:
score: 10
Accepted
time: 209ms
memory: 16888kb
input:
500000 565 17624821 -226543 4449911 -3380117 13846523 5489710 7774242 -4722729 10454903 7817015 9053...
output:
244561
result:
ok single line: '244561'
Test #9:
score: 10
Accepted
time: 219ms
memory: 16892kb
input:
500000 185 14801834 4801294 11077672 -904866 6347759 -7236507 16720881 -4994381 19004510 2370843 486...
output:
15681
result:
ok single line: '15681'
Test #10:
score: 10
Accepted
time: 216ms
memory: 16892kb
input:
500000 569 6710242 349876 10226039 -4243302 16070653 -3583638 5434829 5873968 16513112 -2870742 2921...
output:
252060
result:
ok single line: '252060'