https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/11/Codeforces-Round-443-Div-2-problem-B-Table-Tennis-Solution-In-CC1.png?fit=640%2C360

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 7 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: