当前位置: 代码迷 >> 综合 >> Codeforces Round #516 (Div. 2,C. Oh Those Palindromes(思维水题)
  详细解决方案

Codeforces Round #516 (Div. 2,C. Oh Those Palindromes(思维水题)

热度:63   发布时间:2023-11-15 14:44:10.0

题目链接:http://codeforces.com/contest/1064/problem/C

#include<bits/stdc++.h>
using namespace std;#define debug puts("YES");
#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)
#define read(x,y) scanf("%d%d",&x,&y)
#define ll long long#define lrt int l,int r,int rt
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define root l,r,rt
const int  maxn =2e3+5;
const int mod=1e9+7;
const int ub=1e6;
ll powmod(ll x,ll y){ll t; for(t=1;y;y>>=1,x=x*x%mod) if(y&1) t=t*x%mod; return t;}
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}int n;
int tb[100005];
string s;int main()
{cin>>n>>s;for(int i=0;i<n;i++) tb[i]=s[i]-'a';sort(tb,tb+n);for(int i=0;i<n;i++) cout<<(char)(tb[i]+'a');puts("");return 0;
}

 

  相关解决方案