158612025-03-05 23:01:33fzs1969DNS szakaszok száma (75 pont)cpp17Time limit exceeded 45/75300ms752 KiB
#include <iostream>
using namespace std;

int main() {
    int s;
    cin >> s;
    string ds;
    cin >> ds;
    int vv = 0;
    int v = 0;
    for (int i = 0; i < s; i++) {
        if (ds[i] == 'A') {
            for (int f = i + 1; f < s; f++) {
                if (v == 0) {
                    if (ds[f] == 'G') {
                        v += 1;
                        for (int g = f + 1; g < s; g++) {
                            if (ds[g] == 'T') {
                                vv += 1;
                            }
                        }
                    }
                } else {
                    if (f == s - 1) {
                        v = 0;
                    }
                }
            }
        }
    }
    cout << vv << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/01ms316 KiB
2Time limit exceeded0/0289ms564 KiB
3Accepted3/31ms512 KiB
4Accepted4/41ms316 KiB
5Accepted4/41ms316 KiB
6Accepted4/41ms316 KiB
7Accepted4/41ms508 KiB
8Accepted3/31ms316 KiB
9Accepted3/31ms316 KiB
10Accepted4/41ms316 KiB
11Accepted4/41ms316 KiB
12Accepted4/41ms316 KiB
13Accepted4/42ms316 KiB
14Accepted4/41ms316 KiB
15Time limit exceeded0/3300ms504 KiB
16Time limit exceeded0/4300ms564 KiB
17Time limit exceeded0/4300ms608 KiB
18Time limit exceeded0/4277ms564 KiB
19Time limit exceeded0/4275ms752 KiB
20Time limit exceeded0/4275ms564 KiB
21Time limit exceeded0/3275ms564 KiB
22Time limit exceeded0/4284ms564 KiB