C/C++

Codeforces Round #436 (Div. 2), problem: (B) Polycarp and Letters Solution In C/C++

#include <stdio.h> int c; void reset(){ for(int i=0;i<26;i++){ c=0; } } int main(){ int n,i,cur=0,max=0; scanf("%d",&n); char a; scanf("%s",a); reset(); for(i=0;i<n;i++){ if(a>='A' && a<='Z'){ cur=0; reset(); } else if(c-'a']==0){ c-'a']++; cur++; } if(cur>max){ max=cur; } } printf("%dn",max); return 0; }

Codeforces Round #436 (Div. 2), problem: (A) Fair Game Solution In C/C++

#include<cstdio> #include<iostream> using namespace std; int n,cnt,ans,A,B; int buck; int main(){ scanf("%d",&n); for(int i = 1;i <= n;i++){ cin >> cnt; if(!buck){ ans++; if(A) B = cnt; else A...

Codeforces Round #429 (Div. 1), problem: (D) Destiny Solution In C/C++

#include <bits/stdc++.h> using namespace std; const int maxN = 3e5+10, base = 1e9+7; int N, Q, ans, valmid, A; bool cmp(int...

Codeforces Round #429 (Div. 2), problem: (E) On the Bench Solution In C/C++

#include<bits/stdc++.h> #define ll long long int #define LL long long int #define ULL unsigned long long int #define sf(a) scanf("%d",&a) #define sl(a)...

Codeforces Round #429 (Div. 2), problem: (D) Leha and another game about graph Solution In C/C++

#include<cstdio> using namespace std; const int MAXN = 300000+5; const int MAXE = MAXN*2; int to, nxt, head, ne; void addEdge(int f,...

Codeforces Round #429 (Div. 2), problem: (C) Leha and Function Solution In C/C++

#include<bits/stdc++.h> using namespace std; int main(){ std::ios::sync_with_stdio(false); int m; cin>>m; int a,b; for(int i=0;i<m;i++) cin>>a; vector<pair<int,int> >br(m); for(int i=0;i<m;i++){ cin>>b; br=make_pair(b,i); } sort(a,a+m); int ans; sort(br.begin(),br.end()); reverse(br.begin(),br.end()); for(int i=0;i<m;i++) ans.second]=a; for(int i=0;i<m;i++) cout<<ans<<" "; return 0; }

Codeforces Round #419 (Div. 1), problem: (E) Karen and Neighborhood Solution In C/C++

#include <bits/stdc++.h> using namespace std; typedef pair<long long,long long> ii; long long n,k,i,w,res; long long m; map <long long,long long> num,f,c; long long...

Codeforces Round #419 (Div. 1), problem: (D) Karen and Cards Solution In C/C++

#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 500010; ll maxn,minn,sum; int n,p,q,r,tot=1,x,y,z; ll ret=0; vector<int> c; void update(int a,int...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!