113692024-08-27 21:27:26kukkermanDNS szakaszok száma (75 pont)cpp17Accepted 75/756ms848 KiB
#include <iostream>
#include <string>

std::string beolvas(std::istream &be) {
    int n;
    std::string dns;
    
    be >> n >> dns;

    return dns;
}

void feldolgoz(const std::string &dns) {
    const auto n = static_cast<int>(dns.size());

    unsigned long long a_db = 0u, ag_db = 0u, agt_db = 0u;
    for (int i = 0; i < n; i++) {
        switch (dns[i]) {
        case 'A':
            a_db++;
            break;

        case 'G':
            ag_db = a_db;
            break;

        case 'T':
            agt_db += ag_db;
            break;
        }
    }

    std::cout << agt_db << '\n';
}

int main() {
    const auto dns = beolvas(std::cin);
    feldolgoz(dns);

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms420 KiB
2Accepted0/06ms796 KiB
3Accepted3/32ms424 KiB
4Accepted4/43ms420 KiB
5Accepted4/42ms360 KiB
6Accepted4/43ms360 KiB
7Accepted4/42ms496 KiB
8Accepted3/32ms384 KiB
9Accepted3/33ms384 KiB
10Accepted4/43ms396 KiB
11Accepted4/43ms296 KiB
12Accepted4/43ms400 KiB
13Accepted4/43ms384 KiB
14Accepted4/43ms360 KiB
15Accepted3/36ms616 KiB
16Accepted4/46ms848 KiB
17Accepted4/44ms504 KiB
18Accepted4/44ms632 KiB
19Accepted4/44ms632 KiB
20Accepted4/44ms668 KiB
21Accepted3/34ms632 KiB
22Accepted4/44ms632 KiB