125252024-12-21 15:01:41PappMatyasDNS szakaszok száma (75 pont)cpp17Accepted 75/758ms564 KiB
#include <iostream>

using namespace std;

int main()
{
    long long n, an = 0, ae = 0, ans = 0;
    cin >> n;
    char c;
    for(int i = 0; i < n; i++)
    {
        cin >> c;
        if(c == 'A')
        {
            an++;
        }
        else if(c == 'G')
        {
            ae = an;
        }
        else if(c == 'T')
        {
            ans+=ae;
        }
    }
    cout << ans;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/01ms320 KiB
2Accepted0/08ms512 KiB
3Accepted3/31ms508 KiB
4Accepted4/41ms320 KiB
5Accepted4/41ms320 KiB
6Accepted4/41ms320 KiB
7Accepted4/41ms320 KiB
8Accepted3/31ms516 KiB
9Accepted3/31ms500 KiB
10Accepted4/41ms320 KiB
11Accepted4/41ms320 KiB
12Accepted4/41ms320 KiB
13Accepted4/41ms500 KiB
14Accepted4/41ms540 KiB
15Accepted3/38ms320 KiB
16Accepted4/47ms500 KiB
17Accepted4/47ms404 KiB
18Accepted4/47ms404 KiB
19Accepted4/47ms408 KiB
20Accepted4/47ms320 KiB
21Accepted3/37ms408 KiB
22Accepted4/47ms564 KiB