158632025-03-06 15:11:57rennDNS szakaszok száma (75 pont)cpp17Wrong answer 15/754ms512 KiB
#include <bits/stdc++.h>
using namespace std;

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

    int a = 0, g = 0, t = 0;
    char c;
    bool na = false;
    for(int i = 0; i < n; i++)
    {
        cin >> c;
        if(c == 'A')
        {
            a++;
            na = true;
        }
        if(c == 'G' && na)
        {
            g += a;
            na = false;
        }
        if(c == 'T') t += g;
    }
    cout << t << endl;
}
SubtaskSumTestVerdictTimeMemory
base15/75
1Wrong answer0/01ms316 KiB
2Wrong answer0/03ms316 KiB
3Accepted3/31ms508 KiB
4Wrong answer0/41ms316 KiB
5Accepted4/41ms316 KiB
6Accepted4/41ms316 KiB
7Accepted4/41ms316 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/41ms316 KiB
11Wrong answer0/41ms316 KiB
12Wrong answer0/41ms316 KiB
13Wrong answer0/41ms512 KiB
14Wrong answer0/41ms316 KiB
15Wrong answer0/34ms316 KiB
16Wrong answer0/43ms316 KiB
17Wrong answer0/43ms316 KiB
18Wrong answer0/43ms316 KiB
19Wrong answer0/42ms316 KiB
20Wrong answer0/42ms316 KiB
21Wrong answer0/32ms424 KiB
22Wrong answer0/42ms508 KiB