CodeForces - 1064C Oh Those Palindromes (思维)

题目大意:

      给出一个字符串,让你重新排列这个字符串,使得排列的后的字符串的回文子串数量最多。

题解:

     因为只是要求的字串,一样的放在一起应该是字串最多的,然后就,排个序......就好了.

     

     应该是见过的最简单的Div2的C题了......

#include
#include
using namespace std;
typedef long long ll;

int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    sort(s.begin(),s.end());
    cout<

 

你可能感兴趣的:(ACM,codeforces,思维)