UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#214287#2756. 兔子抓狼Filberte1001022ms5112kbC++11589b2024-11-16 22:59:102024-11-16 23:15:14

answer

#include <bits/stdc++.h>
#define ll long long 
using namespace std;
const int N = 5e5 + 100;
int n;
ll d[N], dt = 1e7, t;
int main(){
    scanf("%d%lld",&n,&t);
    for(int i = 1;i <= n;i++){
        ll x, y;scanf("%lld%lld",&x,&y);
        x -= dt;
        d[i] = x * x + y * y;
    }
    sort(d + 1, d + 1 + n);
    ll Mx = sqrtl(d[n]) + 10;
    int ans = n;
    for(int i = 1;i <= n;i++){
        if(d[i] <= dt * dt){
            dt += t;
            if(dt >= Mx) dt = Mx;
        }
        else{ans = i - 1;break;}
    }
    printf("%d\n",ans);
    return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1196kb

input:

1 0
3397207 6388392



output:

1

result:

ok single line: '1'

Test #2:

score: 10
Accepted
time: 0ms
memory: 1192kb

input:

1 0
2679279 -1344373



output:

1

result:

ok single line: '1'

Test #3:

score: 10
Accepted
time: 123ms
memory: 5112kb

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: 119ms
memory: 5112kb

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: 132ms
memory: 5104kb

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: 126ms
memory: 5100kb

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: 132ms
memory: 5100kb

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: 131ms
memory: 5108kb

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: 135ms
memory: 5104kb

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: 124ms
memory: 5108kb

input:

500000 569
6710242 349876
10226039 -4243302
16070653 -3583638
5434829 5873968
16513112 -2870742
2921...

output:

252060

result:

ok single line: '252060'