https://pintia.cn/problem-sets/994805260223102976/problems/994805283241443328
简单题。
#include<iostream>
using namespace std;
int main() {
int num[123]={0}, temp, lack=0;
int max1=-1, max2=-1;
string str1, str2;
cin >> str1 >> str2;
for(int i=0; i<str1.size(); i++){
temp = str1[i];
num[temp] ++;
}
for(int i=0; i<str2.size(); i++){
temp = str2[i];
num[temp] --;
if(num[temp]<0){
lack ++;
}
}
if(lack == 0){
cout << "Yes " << str1.size() - str2.size();
}else{
cout << "No " << lack;
}
}
博客提供了一个题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805283241443328,并表明是简单题。
431

被折叠的 条评论
为什么被折叠?



