这段代码为什么CE:
#include<bits/stdc++.h>
using namespace std;
int k;
string a, b;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> k;
cin >> a >> b;
a = " " + a;
b = " " + b;
queue<pair<string, int> > q;
q.push({a, 0});
while(q.size()) {
int dist = q.front().second;
string s = q.front().first;
if(dist > k) break;
if(s == b){
cout << "Yes";
return 0;
}
q.pop();
for(int i = 1;i < max((int)s.size(), (int)b.size()); i++){
if(s[i] != b[i]){
string t = s;
t[i] = b[i];
q.push({t, dist + 1});
t = s;
t.insert(i, b[i]);
q.push({t, dist + 1});
t = s;
t.erase(i, 1);
q.push({t, dist + 1});
break;
}
}
}
cout << "No";
return 0;
}