Sponsors

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

Codeforces Round #443 (Div....

#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; }

Advertisement

spot_img