【水题+思维】Codeforces Round #516 C. Oh Those Palindromes

【水题+思维】Codeforces Round #516 C. Oh Those Palindromes

题意:
问如何重排字符串,使得字符串的子川是回文串的数量最多?

思路:
排个序就好了

#include
using namespace std;

#define ll long long
const int MAXN=1e5+10;
char ch[MAXN];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>ch[i];
    sort(ch,ch+n);
    for(int i=0;i<n;i++)
        cout<<ch[i];
    cout<<endl;
    
    return 0;
}

你可能感兴趣的:(【水题+思维】Codeforces Round #516 C. Oh Those Palindromes)