See the receipt of the string time limit: 1000 MS | memory limit: 65535 kb difficulty: 2
-
Description
-
A text return string is a string with the same reading and deserialization. For example, "level" or "Noon" is a text return string. Today, piaoyi met another question about strings: two people play a game and give a string. The two take turns to delete any character in the string. When someone deletes the character, if the string can be reorganized and then is a return string, it wins. If they are smart enough to avoid Operation mistakes, can they win the first hand.
-
Input
-
Multiple groups of test data, enter a string (all strings must be less than 10000 or more than 1 and are all lowercase letters)
-
Output
-
If the first hand wins, the output is yes; otherwise, the output is no. Each group of output results occupies one row.
-
Sample Input
-
aabb
abc
-
Sample output
-
Yes
No
AC code:
#include<stdio.h>char str[10005];int main(){int i,count[26],num;while(~scanf("%s",str)){for(i=0;i<26;i++)count[i]=0;num=0;for(i=0;str[i]!='\0';i++){count[str[i]-'a']++;}for(i=0;i<26;i++){if(count[i]%2==1)num++;}if(num<=2)printf("Yes\n");else{printf("%s\n",num%2==1?"No":"Yes");}}return 0;}