103852024-04-01 18:08:11MagyarKendeSZLGDNS szakaszok száma (75 pont)cpp17Wrong answer 68/756ms3704 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
	cin.tie(0), ios::sync_with_stdio(0);
    
    int N;
    cin >> N;

    int result = 0, before_g = 0, after_g = 0;

    while (N--) {
        char C;
        cin >> C;
        if (C == 'A') after_g++;
        if (C == 'G') {
            before_g += after_g;
            after_g = 0;
        }
        if (C == 'T') {
            result += before_g;
        }
    }

    cout << result;
}
SubtaskSumTestVerdictTimeMemory
base68/75
1Accepted0/03ms1892 KiB
2Accepted0/06ms2120 KiB
3Accepted3/33ms2332 KiB
4Accepted4/43ms2820 KiB
5Accepted4/43ms2944 KiB
6Accepted4/43ms3088 KiB
7Accepted4/43ms3296 KiB
8Accepted3/33ms3296 KiB
9Accepted3/32ms3304 KiB
10Accepted4/43ms3404 KiB
11Accepted4/43ms3488 KiB
12Accepted4/43ms3520 KiB
13Accepted4/42ms3592 KiB
14Accepted4/42ms3592 KiB
15Accepted3/34ms3488 KiB
16Accepted4/44ms3488 KiB
17Accepted4/44ms3500 KiB
18Accepted4/44ms3500 KiB
19Accepted4/44ms3508 KiB
20Accepted4/44ms3504 KiB
21Wrong answer0/34ms3628 KiB
22Wrong answer0/44ms3704 KiB