79982024-01-12 09:55:43tarjanmiciTükörtojás (75 pont)cpp17Time limit exceeded 45/75335ms5004 KiB
#include <iostream>
#include<vector>
using namespace std;

int main() {
    int n, sz = 0;
    cin >> n;
    string most;
    string lesz;
    cin >> most >> lesz;
    vector<int> m(n);
    vector<int> l(n);
    for (int i = 0; i < most.length(); i++) {
        if (most[i] == 'F') {
            m[i] = 0;
        }
        else {
            m[i] = 1;
        }
    }
    for (int i = 0; i < lesz.length(); i++) {
        if (lesz[i] == 'F') {
            l[i] = 0;
        }
        else {
            l[i] = 1;
        }
    }
    for (int i = m.size()-1; i >= 0; i--) {
        if (m[i] != l[i]) {
            for (int j = i; j >= 0; j--) {
                if (m[j] == 0) {
                    m[j] = 1;
                }
                else {
                    m[j] = 0;
                }
            }
            sz++;
        }
    }
    cout << sz;
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/03ms1812 KiB
2Time limit exceeded0/0298ms1852 KiB
3Accepted5/53ms2248 KiB
4Accepted5/53ms2472 KiB
5Accepted5/53ms2680 KiB
6Accepted5/53ms2916 KiB
7Accepted5/53ms2972 KiB
8Accepted5/53ms3204 KiB
9Accepted5/53ms3224 KiB
10Accepted5/53ms3304 KiB
11Accepted5/53ms3368 KiB
12Time limit exceeded0/5300ms3820 KiB
13Time limit exceeded0/5266ms4100 KiB
14Time limit exceeded0/5282ms4324 KiB
15Time limit exceeded0/5333ms4712 KiB
16Time limit exceeded0/5335ms4932 KiB
17Time limit exceeded0/5270ms5004 KiB