夏义博 @ 2018-10-29 18:42:14
#include<iostream>
using namespace std;
int f[1001],h[1001],n,s,a,d,g=0;
int main()
{
cin>>n>>s;
cin>>d>>a;
for(int i=1; i<=n; i++)
for(int j=1; j<=n; j++) {
cin>>f[i];
cin>>h[j];
}
for(int w=1; w<=n; w++)
for(int e=1; e<=n; e++) {
if(h[w]>h[w+1]) {
if(d>=f[e]&&d+a>=f[e]) {
g++;
}
}
}
cout<<g;
return 0;
}
by 夏义博 @ 2018-10-29 19:14:13
贪心不行么?
by encore @ 2018-10-29 19:14:53
@夏义博 好像不行
by 夏义博 @ 2018-10-29 19:19:57
有何指教
by 夏义博 @ 2018-10-29 19:20:41
做出来了