| ||||||||||
| 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 | |||||||||
Re:为什么我101就过了?In Reply To:测试数组大小100没过,105ac了 Posted by:20162430206 at 2018-04-01 14:55:30 #include <iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int main()
{
char a[101]="", b[101]="";
int x[26]={0}, y[26]={0}, i, len1, len2;
cin >> a >> b;
len1 = strlen(a), len2 = strlen(b);
for (i = 0; i < len1; i++)
x[a[i] - 'A']++;
for (i = 0; i < len2; i++)
y[b[i] - 'A']++;
sort(x, x + 26);
sort(y, y + 26);
for (i = 0; i < 26; i++)
{
if (x[i] != y[i])
{
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << 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