0
已解决
曾心
高级守护
高级守护
题目链接: 酷町堂:3103
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <iomanip>
#include <stdio.h>
#include <string>
#include <cstring>
using namespace std;
string a;
int maxn,b[200],minn;
bool f(int x){
int sum=1;
if(x==1){
return false;
}
for(int i=2;i<=x/2;i++){
if(x%i==0){
return false;
}
}
return true;
}
int main(){
cin>>a;
for(int i=0;i<=a.size()-1;i++){
b[a[i]]++;
}
for(int i=97;i<=160;i++){
minn=min(minn,b[i]);
maxn=max(maxn,b[i]);
}
if(f(maxn-minn)){
cout<<"Lucky Word"<<endl<<maxn-minn;
}else{
cout<<"No Answer"<<endl<<maxn-minn;
}
return 0;
}