标签:bzoj3893 usaco2014 cow-jog 乱搞
200多b的朋友真是hentai.
#include <stdio.h>
int main()
{
puts("转载请注明出处[vmurder]谢谢");
puts("网址:blog.csdn.net/vmurder/article/details/43969649");
}
排个序从后往前扫一遍看哪些撞死了。
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define N 101000
using namespace std;
long long n,m;
long long p[N],s[N];
int main()
{
freopen("test.in","r",stdin);
cin>>n>>m;
int i;
for(i=1;i<=n;i++)cin>>p[i]>>s[i];
int ans=0;
for(i=n;i;i--)
{
int now=i;ans++;
while(i&&(s[i-1]-s[now])*m>=(p[now]-p[i-1]))i--;
}
cout<<ans<<endl;
return 0;
}
【BZOJ3893】【Usaco2014 Dec】Cow Jog 乱搞
标签:bzoj3893 usaco2014 cow-jog 乱搞
原文地址:http://blog.csdn.net/vmurder/article/details/43969649