70622023-12-29 10:16:25MagyarKendeSZLGTükörtojás (75 pont)cpp17Accepted 75/758ms3448 KiB
#include <bits/stdc++.h>

#define speed cin.tie(0); ios::sync_with_stdio(0)

using namespace std;

int main() {
    speed;

    int N;
    cin >> N;
    vector<bool> A(N), B(N);
    
    char c;
    for (int i = 0; i < N; i++) {
        cin >> c;
        A[i] = c == 'F';
    }
    for (int i = 0; i < N; i++) {
        cin >> c;
        B[i] = c == 'F';
    }

    int count = 0;
    for (int i = N - 1; i >= 0; i--) {
       count += (A[i] == B[i]) == (count & 1);
    }

    cout << count;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1824 KiB
2Accepted0/06ms2072 KiB
3Accepted5/53ms2144 KiB
4Accepted5/53ms2276 KiB
5Accepted5/53ms2484 KiB
6Accepted5/53ms2840 KiB
7Accepted5/53ms2912 KiB
8Accepted5/53ms3024 KiB
9Accepted5/53ms2992 KiB
10Accepted5/53ms2996 KiB
11Accepted5/53ms3124 KiB
12Accepted5/58ms3188 KiB
13Accepted5/58ms3192 KiB
14Accepted5/58ms3448 KiB
15Accepted5/58ms3404 KiB
16Accepted5/58ms3404 KiB
17Accepted5/58ms3404 KiB