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 |
vector写法,dalao莫喷#include <iostream> #include <algorithm> #include <vector> #include <cmath> #include <cstdio> using namespace std; int main() { string str1,str2; while(cin>>str1>>str2){ vector<int>v1(30),v2(30); for(int i=0;i<str1.size();++i)v1[str1[i]-'A']++; for(int i=0;i<str2.size();++i)v2[str2[i]-'A']++; sort(v1.begin(),v1.end()); sort(v2.begin(),v2.end()); if(v1==v2)cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator