Codeforces Round #443 (Div. 2), problem: (B) Table Tennis Solution In C/C++

#include <iostream>
using namespace std;
int main()
{
long long n,k,a,m=0,ab=0;
cin>>n>>k>>ab;
while(–n){
cin>>a;
if(m==k){break;}
if(ab>a){m++;}
else
ab=a,m=1;
}
cout<<ab;
}

(Visited 30 times, 1 visits today)

About the Author:

Leave A Comment