Tinkoff Challenge – Final Round (Codeforces Round #414 Archive

Tinkoff Challenge – Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2), problem: (G) Replace All Solution In C/C++

Tinkoff Challenge – Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2), problem: (G) Replace All Solution In C/C++

#include<set> #include<map> #include<ctime> #include<cmath> #include<queue> #include<bitset> #include<string> #include<cstdio> #include<cctype> #include<vector> #include<cstdlib> #include<cstring> #include<cassert> #include<sstream> #include<numeric> #include<iostream> #include<algorithm> #include<functional> using namespace std; #define For(i,x,y) for(int i=x,_y=y;i<=_y;++i) #define Rep(i,x,y) for(int i=x,_y=y;i>=_y;–i) #define pub push_back #define pob pop_back …
Tinkoff Challenge – Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2), problem: (E) Choosing Carrot Solution In C/C++

Tinkoff Challenge – Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2), problem: (E) Choosing Carrot Solution In C/C++

#include<iostream> #include<cstdio> #include<fstream> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #include<cmath> #include<cstring> #include<cstdlib> using namespace std; int a,b; int main() { int n,i,x,y; cin>>n; for(i=1;i<=n;i=i+1) cin>>a; for(i=1;i<=n;i=i+1) { x=(i-1)-(n-i); if(x<0) x=-x; b=max(b,a); } for(i=1;i<n;i=i+1) { x=(i-1)-(n-i-1); if(x<0) …
Tinkoff Challenge – Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2), problem: (D) Labelling Cities Solution In C/C++

Tinkoff Challenge – Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2), problem: (D) Labelling Cities Solution In C/C++

#include<bits/stdc++.h> #define MAXN 300100 using namespace std; struct node{int y,next;}e; int n,m,len,Link,p,hash,col,vis,used; inline int read(){ int x=0,f=1; char ch=getchar(); while(!isdigit(ch)) {if(ch==’-‘) f=-1; ch=getchar();} while(isdigit(ch)) {x=x*10+ch-‘0’; ch=getchar();} return x*f; } void insert(int x,int y){e.next=Link;Link=len;e.y=y;} void dfs(int …
Tinkoff Challenge – Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2), problem: (C) Naming Company Solution In C/C++

Tinkoff Challenge – Final Round (Codeforces Round #414, rated, Div. 1 + Div. 2), problem: (C) Naming Company Solution In C/C++

#include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define MN 300000 char a,b,c; bool cmp(char x,char y){return x>y;} int main() { int n,i,al,ar,bl,br,cl,cr; scanf(“%s%s”,a,b); n=strlen(a); sort(a,a+n);sort(b,b+n,cmp); al=0;ar=n+1>>1;bl=0;br=n>>1;cl=0;cr=n; for(i=0;i<n;++i) if(i&1) if(b>a)c=b; else c=b; else if(a<b)c=a; else c=a; puts(c); …