Sponsors

Tag: Codeforces Round #443 (Div. 2)

Codeforces Round #443 (Div....

#include<cstdio> #include<cstring> #include<algorithm> #include<set> using namespace std; int n,k; struct node { int maxx,minn,sz; node() { int x;sz = 1; for(int...

Codeforces Round #443 (Div....

#include <stdio.h> struct node { __int64 ans,num; }s; int main() { int n,k,m; while(~scanf("%d%d%d",&n,&k,&m)) { scanf("%I64d",&s.num); s.ans=1; int len=1; for(int i=1;i<n;i++) { int x; scanf("%d",&x); if(x==s.num) { s.ans++; if(s.ans==k) { s.ans=0; len--; } } else { s.num=x; s.ans=1; len++; } } int...

Codeforces Round #443 (Div....

#include <iostream> using namespace std; const int maxn = 5e5; int n,...

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

Codeforces Round #443 (Div....

#include<bits/stdc++.h> using namespace std; int main() { int n,i,s,d,t=0; cin>>n; for(i=0;i<n;i++) { cin>>s>>d; while(s<=t) { s=s+d; } t=s; } cout<<s<<endl; }

Advertisement

spot_img