首页 > 代码库 > CodeForces 716A Crazy Computer

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