Tag: problem: (C) Naming Company Solve 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); }

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!