Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Hash之~~大牛莫见怪~~#include<cstdio> #include<cstdlib> const int MAXSIZE=26; int anum[MAXSIZE],bnum[MAXSIZE]; int main(){ char ch; while((ch=getchar())!='\n') ++anum[ch-'A']; while((ch=getchar())!='\n') ++bnum[ch-'A']; int hash1=0,hash2=0; for(int i=0;i!=MAXSIZE;++i){ hash1+=anum[i]*anum[i]; hash2+=bnum[i]*bnum[i]; } if(hash1==hash2) printf("YES"); else printf("NO"); return EXIT_SUCCESS; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator