洛谷 P1125 笨小猴
思路
水题
用大小为26的数组存储每个字母出现的次数,最后排个序,把次数为0的字母去掉,用最大的次数减去最小的非零次数,判断质数就行。
代码
/*
* @Description:
* @Author: 多多
* @Date: 2020-10-24 13:23:05
* @LastEditTime: 2020-10-24 13:32:12
* @LastEditors: 多多
*/
#include <bits/stdc++.h>
using namespace std;
bool judge(int x)
{
if (x < 2)
{
return false;
}
if (x == 2)
{