UVA 1339 Ancient Cipher(水题)
2016-10-03 16:25
344 查看
题意好难看懂。
// // main.cpp // Richard // // Created by 邵金杰 on 16/10/3. // Mail:1016427040@qq.com or jasonshaosjj@gmail.com // Copyright © 2016年 邵金杰. All rights reserved. // #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn=100+10; int a[26],b[26]; char s1[maxn],s2[maxn]; int main() { while(scanf("%s%s",s1,s2)!=EOF) { memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); for(int i=0;s1[i];i++) {a[s1[i]-'A']++;b[s2[i]-'A']++;} sort(a,a+26); sort(b,b+26); bool ok=true; for(int i=0;i<26;i++) if(a[i]!=b[i]) {ok=false;break;} if(ok) printf("YES\n"); else printf("NO\n"); } return 0; }
相关文章推荐
- UVa 1339 Ancient Cipher --- 水题
- NEERC 2004 / UVa 1339 Ancient Cipher (模拟)
- K - Ancient Cipher UVA - 1339
- UVA 1339 - Ancient Cipher(题意)(排序)
- Uva-1339 Ancient Cipher
- uva_1339_Ancient Cipher
- UVa1339 Ancient Cipher
- UVa 1339 - Ancient Cipher
- Uva - 1339 - Ancient Cipher
- UVA 1339 - Ancient Cipher
- UVA - 1339 Ancient Cipher
- Uva - 1339 - Ancient Cipher
- UVA - 1339 Ancient Cipher
- Ancient Cipher,NEETC 2004,UVa1339
- UVA 1339 - Ancient Cipher
- 【例题 4-1 UVA - 1339】 Ancient Cipher
- UVa 1339 Ancient Cipher
- UVa 1339 Ancient Cipher
- UVA 1339 Ancient Cipher(映射 | 想法)
- Uva - 1339 - Ancient Cipher