ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#214273 | #2756. 兔子抓狼 | naroto2022 | 0 | 608ms | 12840kb | C++ | 955b | 2024-11-16 22:20:42 | 2024-11-16 23:14:18 |
answer
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#define ll long long
using namespace std;
const int MN=5e5+5;
ll n,t,s[MN],ans,num;
struct point{ll x,y;}p[MN];
void write(ll n){if(n<0){putchar('-');write(-n);return;}if(n>9)write(n/10);putchar(n%10+'0');}
ll read(){ll x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}return x*f;}
bool cmp(point a, point b){return a.x==b.x?a.y<b.y:a.x<b.x;}
int main(){
n=read();t=read();
for(int i=1; i<=n; i++) p[i].x=read(),p[i].y=read();
for(int i=1; i<=n; i++) s[i]=abs(p[i].x-p[i-1].x)+abs(p[i].y-p[i-1].y);\
if(s[1]>2) write(0);
else{
num=t;ans=1;
for(int i=2; i<=n; i++){
if(s[i]<=num){
num+=t-s[i];
ans++;
}
}
write(ans);
}
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1132kb
input:
1 0 3397207 6388392
output:
0
result:
wrong answer 1st lines differ - expected: '1', found: '0'
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 1132kb
input:
1 0 2679279 -1344373
output:
0
result:
wrong answer 1st lines differ - expected: '1', found: '0'
Test #3:
score: 0
Wrong Answer
time: 60ms
memory: 12836kb
input:
500000 0 8471505 -6326291 10788878 8737969 3351532 1897516 1403680 -233153 12636871 1246248 18100435...
output:
0
result:
wrong answer 1st lines differ - expected: '476349', found: '0'
Test #4:
score: 0
Wrong Answer
time: 73ms
memory: 12840kb
input:
500000 0 7441739 5853841 11544686 3514854 11336539 -5996122 8433392 -5095732 6081015 -7332291 643085...
output:
0
result:
wrong answer 1st lines differ - expected: '476375', found: '0'
Test #5:
score: 0
Wrong Answer
time: 85ms
memory: 12836kb
input:
500000 24 16091253 -4872181 18656204 2680986 14707406 -3518171 17153405 3563871 12890379 1612135 187...
output:
0
result:
wrong answer 1st lines differ - expected: '10441', found: '0'
Test #6:
score: 0
Wrong Answer
time: 72ms
memory: 12840kb
input:
500000 168 18569140 -3518474 15777516 1736149 17560051 501909 15235439 -8056987 13084029 -1624084 10...
output:
0
result:
wrong answer 1st lines differ - expected: '14885', found: '0'
Test #7:
score: 0
Wrong Answer
time: 69ms
memory: 12840kb
input:
500000 104 13110797 5397737 16961793 1660107 12525824 -403106 14379422 2847808 12226373 -9482183 140...
output:
0
result:
wrong answer 1st lines differ - expected: '12465', found: '0'
Test #8:
score: 0
Wrong Answer
time: 91ms
memory: 12836kb
input:
500000 565 17624821 -226543 4449911 -3380117 13846523 5489710 7774242 -4722729 10454903 7817015 9053...
output:
0
result:
wrong answer 1st lines differ - expected: '244561', found: '0'
Test #9:
score: 0
Wrong Answer
time: 73ms
memory: 12836kb
input:
500000 185 14801834 4801294 11077672 -904866 6347759 -7236507 16720881 -4994381 19004510 2370843 486...
output:
0
result:
wrong answer 1st lines differ - expected: '15681', found: '0'
Test #10:
score: 0
Wrong Answer
time: 85ms
memory: 12840kb
input:
500000 569 6710242 349876 10226039 -4243302 16070653 -3583638 5434829 5873968 16513112 -2870742 2921...
output:
0
result:
wrong answer 1st lines differ - expected: '252060', found: '0'