80852024-01-12 12:30:41David9320Tükörtojás (75 pont)cpp17Accepted 75/758ms3788 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

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

    string indulas;
    string cel;
    int forditas = 0;

    cin >> indulas >> cel;

    for(int i = n - 1; i >= 0; i--) {
        if(forditas % 2 == 0 && indulas[i] != cel[i]) {
            forditas++;
        }
        if(forditas % 2 == 1 && indulas[i] == cel[i]) {
            forditas++;
        }
    }

    cout << forditas;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1820 KiB
2Accepted0/04ms2304 KiB
3Accepted5/53ms2396 KiB
4Accepted5/53ms2500 KiB
5Accepted5/53ms2652 KiB
6Accepted5/52ms2732 KiB
7Accepted5/53ms2728 KiB
8Accepted5/53ms2828 KiB
9Accepted5/53ms2928 KiB
10Accepted5/53ms2964 KiB
11Accepted5/53ms2936 KiB
12Accepted5/58ms3456 KiB
13Accepted5/58ms3316 KiB
14Accepted5/58ms3516 KiB
15Accepted5/58ms3744 KiB
16Accepted5/58ms3636 KiB
17Accepted5/58ms3788 KiB