Tuesday, September 20, 2016

Codeforces 716A Solution

Unknown
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,c;
    scanf("%d%d",&n,&c);
    int ans=0;
    int d=0;
    while (n--)
    {
        int t;
        scanf("%d",&t);
        if (t-d>c) ans=1;
        else ans++;
        d=t;
    }
    printf("%d\n",ans);
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,