Tag: Codeforces Round #410 (Div. 2)

Codeforces Round #410 (Div. 2), problem: (E) Mike and code of a permutation Solution In C/C++

#pragma warning(disable:4996) #include <stdio.h> #include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <string.h> #include <stdlib.h> #include <assert.h> #include <cmath> #include <map> #include <set> #include <queue> #include <complex> #include <iterator> #include <random> #include...

Codeforces Round #410 (Div. 2), problem: (D) Mike and distribution Solution In C/C++

#include<bits/stdc++.h> using namespace std; const int maxn=100000+10; int b,n,flag=1,dp; struct node { int id,x; }a; int cmp(node a,node b) { return a.x>b.x; } int main() { scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a.x); a.id=i; } sort(a+1,a+n+1,cmp); for(int i=1;i<=n;i++) scanf("%d",&b); int k=n/2+1; printf("%dn%dn",k,a.id); for(int...

Codeforces Round #410 (Div. 2), problem: (C) Mike and gcd problem Solution In C/C++

#include <bits/stdc++.h> using namespace std; int main(){ int n, num = 0, x, sum = 0; scanf("%d", &n); int g=0; for(int i =...

Codeforces Round #410 (Div. 2), problem: (B) Mike and strings Solution In C/C++

#include <bits/stdc++.h> using namespace std; string s; int main() { int n, t, ans; ans = INT_MAX; cin>>n; string temp; for(int i=0; i<n; i++) cin>>s; for(int i=0; i<n;...

Codeforces Round #410 (Div. 2), problem: (A) Mike and palindrome Solution In C/C++

#include<iostream> using namespace std; main() { string s;cin>>s; int n=s.size(),cnt=0; for(int i=0;i<n/2;i++) { if(s!=s)cnt++; } cout<<(cnt==1||cnt==0&&n%2==1?"YES":"NO")<<endl; }

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!