P13491 【MX-X14-T1】拼凑基因
题目传送门
题目大意
两个字符串
思路
可以使用两个 map 来存储两个字符串。如果字符串
AC Code:
#include <bits/stdc++.h>
using namespace std;
map<char,int> ss,tt;
int main()
{
int n;
cin>>n;
string s,t;
cin >>s>>t;
for(char c:s)
{
ss[c]++;
}
for(char c:t)
{
tt[c]++;
}
for(auto x:tt)
{
if(tt[x.first]>ss[x.first])
{
cout <<"No";
exit(0);
}
}
cout <<"Yes";
return 0;
}