这个题我本来看错意思了。
我以为,他所谓的替换规则(substitution) 一定是 B-->A,,,,,以此类推。
但是,通过样例我们发现,替换规则并不是这样。。。。
最大的感受就是,英语很重要,要在平时的练习中逐渐适应读英语。
#include<iostream>
#include<algorithm>
#include<stack>
#include<set>
#include<queue>
#include<map>
#include<string>
#include<cstring>
#include<vector>
#include<ctype.h>
#include<cstdlib>
using namespace std;
int main()
{
char str1[100],str2[100];
while(cin>>str1>>str2)
{
int cnt1[27],cnt2[27],tmp;
memset(cnt1,0,sizeof(cnt1));
memset(cnt2,0,sizeof(cnt2));
for(int i=0;str1[i];i++)
cnt1[str1[i]-'A'+1]++;
for(int j=0;str2[j];j++)
cnt2[str2[j]-'A'+1]++;
sort(cnt1,cnt1+27);
sort(cnt2,cnt2+27);
int k;
for( k=1;k<=26;k++)
if(cnt1[k]!=cnt2[k]) break;
if(k==27) cout<<"YES\n";
else cout<<"NO\n";
}
}
//这个题,的收获是:1,要是连读题都读不懂就凉凉了,即使你掌握了相关知识
立个flag,近几天我要学会STL的基本用法。。。今天做题,map还不会用。
然后,石油大上有一些18级的人已经解决九百多个题了。
嗯,多做题。