Solution
2024-05-30 22:37:38
发布于:广东
0阅读
0回复
0点赞
#include <iostream>
#include <string>
using namespace std;
using ll = long long;
int main() {
//freopen("breedflip.in", "r", stdin);
//freopen("breedflip.out", "w", stdout);
ll n;
cin >> n;
string A;
string B;
cin >> A >> B;
ll ans = 0;
bool mismatched = false;
for (ll i = 0; i < n; i++) {
if (A[i] != B[i]) {
if (!mismatched) {
mismatched = true;
ans++;
}
} else {
mismatched = false;
}
}
cout << ans << endl;
}
这里空空如也
有帮助,赞一个