75632024-01-09 17:18:33AblablablaTükörtojás (75 pont)cpp17Accepted 75/758ms3804 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;

    string a, b;
    cin >> a >> b;

    int valasz = 1;
    for(int i = 1; i < n; i++){
        if((a[i - 1] == b[i - 1]) != (a[i] == b[i])){
            valasz++;
        }
    }

    if(a[n - 1] == b[n - 1]){
        valasz--;
    }

    cout << valasz << "\n";
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1808 KiB
2Accepted0/04ms2304 KiB
3Accepted5/53ms2212 KiB
4Accepted5/53ms2424 KiB
5Accepted5/53ms2540 KiB
6Accepted5/53ms2612 KiB
7Accepted5/53ms2852 KiB
8Accepted5/53ms2832 KiB
9Accepted5/53ms3116 KiB
10Accepted5/53ms3104 KiB
11Accepted5/53ms3112 KiB
12Accepted5/57ms3580 KiB
13Accepted5/58ms3784 KiB
14Accepted5/57ms3804 KiB
15Accepted5/57ms3584 KiB
16Accepted5/57ms3588 KiB
17Accepted5/57ms3584 KiB