103842024-04-01 18:02:23MagyarKendeSZLGDNS szakaszok száma (75 pont)cpp17Wrong answer 68/756ms4524 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 == 'C') continue;
        if (C == 'A') before_g++;
        else if (C == 'G') {
            after_g += before_g;
            before_g = 0;
        }
        else {
            result += after_g;
        }
    }

    cout << result;
}
SubtaskSumTestVerdictTimeMemory
base68/75
1Accepted0/03ms1892 KiB
2Accepted0/06ms2264 KiB
3Accepted3/33ms2232 KiB
4Accepted4/43ms2596 KiB
5Accepted4/43ms2672 KiB
6Accepted4/43ms2772 KiB
7Accepted4/43ms2980 KiB
8Accepted3/33ms3052 KiB
9Accepted3/33ms3184 KiB
10Accepted4/43ms3296 KiB
11Accepted4/43ms3492 KiB
12Accepted4/43ms3708 KiB
13Accepted4/43ms3916 KiB
14Accepted4/42ms4004 KiB
15Accepted3/34ms4012 KiB
16Accepted4/44ms4004 KiB
17Accepted4/44ms4236 KiB
18Accepted4/44ms4460 KiB
19Accepted4/44ms4432 KiB
20Accepted4/44ms4436 KiB
21Wrong answer0/34ms4432 KiB
22Wrong answer0/44ms4524 KiB