CF1832A New Palindrome

//已是回文
#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-') f=-f;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
} 
const int MAXN=27;
int n,cnt[MAXN];
string s;
signed main(){
    n=read();
    while(n--){
        cin>>s;
        memset(cnt,0,sizeof(cnt));
        for(int i=0;i<s.length();i++)
            cnt[s[i]-'a']++;
        int sum=0; 
        for(int i=0;i<26;i++)
            if(cnt[i]>1) sum++;
        if(sum>1) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}
View Code
 

 

 
posted @ 2023-07-18 22:15  JMXZ  阅读(8)  评论(0)    收藏  举报