113682024-08-27 21:25:59kukkermanDNS szakaszok száma (75 pont)cpp17Wrong answer 68/756ms628 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());

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

        case 'G':
            ag_db += a_db;
            a_db = 0;
            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
base68/75
1Accepted0/02ms360 KiB
2Accepted0/06ms620 KiB
3Accepted3/33ms420 KiB
4Accepted4/43ms292 KiB
5Accepted4/42ms360 KiB
6Accepted4/42ms360 KiB
7Accepted4/42ms360 KiB
8Accepted3/32ms364 KiB
9Accepted3/32ms504 KiB
10Accepted4/43ms256 KiB
11Accepted4/43ms360 KiB
12Accepted4/43ms456 KiB
13Accepted4/42ms360 KiB
14Accepted4/43ms256 KiB
15Accepted3/34ms628 KiB
16Accepted4/44ms508 KiB
17Accepted4/46ms504 KiB
18Accepted4/44ms504 KiB
19Accepted4/44ms528 KiB
20Accepted4/44ms616 KiB
21Wrong answer0/34ms616 KiB
22Wrong answer0/44ms488 KiB