//思路:对字符串全体进行遍历并计数,如果出现一个奇数或者无奇数则yse,否则NO;
#include<stdio.h>
#include<string.h>
char num[1001];
char alp[30];
int main()
{while (scanf("%s",num)!=EOF){int cnt=0;int n=strlen(num); for(int i=0;i<n;i++){alp[num[i]-'a']++;}for(int i=0;i<26;i++){if(alp[i]%2!=0) cnt++;}if(cnt>=2) printf("No\n");else printf("Yes\n"); memset(num,0,sizeof(num));memset(alp,0,sizeof(alp)); }return 0;
}
详细解决方案
XTU OJ Palindrome 1351
热度:33 发布时间:2023-12-04 21:58:22.0
相关解决方案
- LeetCode 409. Longest Palindrome
- Leetcode —— Palindrome Number
- LeetCode刷题笔记-009:palindrome number(回文数)
- Codeforces Round #311 (Div. 2) E - Ann and Half-Palindrome(字典树+dp)
- 欧拉计划004--Largest palindrome product
- XTU OJ Palindrome 1351
- A-B Palindrome
- POJ 3280Cheapest Palindrome(区间DP)
- POJ-3280 Cheapest Palindrome DP 鶸的DP解题报告
- Code Forces 486C Palindrome Transformation
- 区间dp poj3280 Cheapest Palindrome
- 滚动数组 poj1159 Palindrome
- Palindrome Partitioning II - Leetcode
- Palindrome Partitioning - Leetcode
- poj-1159-Palindrome-学习滚动数组
- 2017 CCPC哈尔滨站 Palindrome (马拉车+树状数组)
- C - Palindrome URAL - 1297
- poj3974 Palindrome
- HDU-6264 Super-palindrome(思维题)
- hdu 6156 palindrome function #数位dp 3
- POJ 3974 Palindrome 回文串
- Palindrome Number leetcode
- LeetCode 131 Palindrome Partitioning
- leetcode 9回文数(palindrome-number)
- POJ1159---Palindrome(dp,LCS)
- leetcode_13 Palindrome Number