175502025-07-18 17:12:44sarminTükörtojás (75 pont)cpp17Accepted 75/7592ms936 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int n; cin >> n;
    string a, b; cin >> a >> b;
    int ugyan = -1, ans = 0;
    for (int i = 0; i < n; i++) {
        if (ugyan == -1) {
            if (a[i] == b[i]) ugyan = 0; // egyenlo
            else ugyan = 1; // kulonbozo
        } else if (ugyan == 0 && a[i] != b[i]) {
            cerr << i << ": " << i << " - " << "ugyanaz\n";
            ans++; ugyan = 1;
        } else if (ugyan == 1 && a[i] == b[i]) {
            cerr << i << ": " << i << " - " << "kulonbozik\n";
            ans++; ugyan = 0;
        }
    }
    if (ugyan == 1) ans++;
    cout << ans;
	
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/01ms316 KiB
2Accepted0/046ms756 KiB
3Accepted5/51ms316 KiB
4Accepted5/51ms316 KiB
5Accepted5/51ms424 KiB
6Accepted5/51ms316 KiB
7Accepted5/51ms316 KiB
8Accepted5/52ms500 KiB
9Accepted5/52ms508 KiB
10Accepted5/52ms508 KiB
11Accepted5/52ms552 KiB
12Accepted5/590ms876 KiB
13Accepted5/590ms820 KiB
14Accepted5/590ms928 KiB
15Accepted5/592ms820 KiB
16Accepted5/590ms932 KiB
17Accepted5/590ms936 KiB