题意: 给出t组测试数据,每组给出正整数n表示有n种字符,接下来给出n个数表示该种字符的数目,操作一下,使得可以构造的最小回文串字符数目最大且输出. 分析: 如果每个字符出现次数都是偶数, 那么答案显然就是所有数的和. 对于奇数部分, 显然需要把其他字符均匀分配给这写奇数字符. 随便计算下就好了. 即统计所有的字符的数目,奇数则-1再加上去,并且计数器count++,完成之后就输出数目,公式为字符数目=(sum/2)/count*2+1,其实就是平均了一下. 代码: #include<cstdi…