CodeForces 716A Crazy Computer

Posted shuoed

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CodeForces 716A Crazy Computer相关的知识,希望对你有一定的参考价值。

题目链接:

题目大意:

  留坑!

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 int main()
 4 {
 5     int n,c;
 6     while(scanf("%d%d",&n,&c)!=EOF)
 7     {
 8         int i;
 9         int x,x1,cut=0;
10         scanf("%d",&x);
11         for(i=1; i<n; i++)
12         {
13             scanf("%d",&x1);
14             if((x1-x)>c)
15                 cut=0;
16             else cut++;
17             x=x1;
18         }
19         printf("%d\n",cut+1);
20     }
21     return 0;
22 }

 

以上是关于CodeForces 716A Crazy Computer的主要内容,如果未能解决你的问题,请参考以下文章