#include<bits/stdc++.h>
using namespace std;
unordered_map<char, int> mp;
int main() {
int flag = 0, need = 0;
string s1, s2;
cin >> s1 >> s2;
for (int i = 0; i < s1.size(); i++) mp[s1[i]]++;
for (int i = 0; i < s2.size(); i++) {
if (mp[s2[i]] <= 0) {
flag = 1;
need++;
}
mp[s2[i]]--;
}
if (flag == 0) printf ("Yes %d", s1.size() - s2.size());
else printf ("No %d", need);
}
PATA1092_map应用(难度:⭐️)
最新推荐文章于 2021-09-01 11:59:09 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)