125232024-12-21 14:57:56PappMatyasDNS szakaszok száma (75 pont)cpp17Wrong answer 60/754ms656 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, an = 0, ae = 0, ans = 0;
    cin >> n;
    char c[100000];
    cin >> c;
    for(int i = 0; i < n; i++)
    {
        if(c[i] == 'A')
        {
            an++;
        }
        else if(c[i] == 'G')
        {
            ae = an;
        }
        else if(c[i] == 'T')
        {
            ans+=ae;
        }
    }
    cout << ans;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base60/75
1Accepted0/01ms320 KiB
2Accepted0/04ms320 KiB
3Accepted3/31ms320 KiB
4Accepted4/41ms320 KiB
5Accepted4/41ms320 KiB
6Accepted4/41ms320 KiB
7Accepted4/41ms320 KiB
8Accepted3/31ms520 KiB
9Accepted3/31ms320 KiB
10Accepted4/41ms320 KiB
11Accepted4/41ms320 KiB
12Accepted4/41ms656 KiB
13Accepted4/41ms320 KiB
14Accepted4/41ms320 KiB
15Accepted3/33ms480 KiB
16Accepted4/43ms408 KiB
17Accepted4/43ms320 KiB
18Accepted4/43ms320 KiB
19Wrong answer0/43ms560 KiB
20Wrong answer0/43ms320 KiB
21Wrong answer0/33ms320 KiB
22Wrong answer0/43ms320 KiB