ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#185178 | #2756. 兔子抓狼 | wosile | 100 | 1006ms | 12924kb | C++ | 477b | 2023-09-24 09:26:04 | 2023-09-24 12:02:09 |
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll D=10000000;
ll x[500005],y[500005];
ll dis[500005];
int main(){
int n,t;
scanf("%d%d",&n,&t);
for(int i=1;i<=n;i++)scanf("%lld%lld",&x[i],&y[i]);
for(int i=1;i<=n;i++)dis[i]=(x[i]-D)*(x[i]-D)+y[i]*y[i];
sort(dis+1,dis+n+1);
// for(int i=1;i<=n;i++)printf("%lld ",dis[i]);printf("\n");
int pos=0;
while(pos<n && dis[pos+1]<=D*D){
pos++;
D+=t;
}
printf("%d",pos);
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1200kb
input:
1 0 3397207 6388392
output:
1
result:
ok single line: '1'
Test #2:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
1 0 2679279 -1344373
output:
1
result:
ok single line: '1'
Test #3:
score: 10
Accepted
time: 117ms
memory: 12920kb
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: 118ms
memory: 12924kb
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: 130ms
memory: 12916kb
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: 137ms
memory: 12916kb
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: 117ms
memory: 12916kb
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: 122ms
memory: 12916kb
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: 133ms
memory: 12920kb
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: 132ms
memory: 12920kb
input:
500000 569 6710242 349876 10226039 -4243302 16070653 -3583638 5434829 5873968 16513112 -2870742 2921...
output:
252060
result:
ok single line: '252060'