113672024-08-27 21:22:27kukkermanDNS szakaszok száma (75 pont)cpp17Wrong answer 68/756ms912 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;
            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/02ms532 KiB
2Accepted0/06ms784 KiB
3Accepted3/33ms488 KiB
4Accepted4/43ms360 KiB
5Accepted4/43ms440 KiB
6Accepted4/43ms360 KiB
7Accepted4/43ms400 KiB
8Accepted3/33ms548 KiB
9Accepted3/33ms400 KiB
10Accepted4/43ms616 KiB
11Accepted4/43ms384 KiB
12Accepted4/42ms504 KiB
13Accepted4/42ms376 KiB
14Accepted4/43ms420 KiB
15Accepted3/36ms800 KiB
16Accepted4/46ms784 KiB
17Accepted4/44ms616 KiB
18Accepted4/44ms884 KiB
19Accepted4/44ms912 KiB
20Accepted4/44ms616 KiB
21Wrong answer0/34ms616 KiB
22Wrong answer0/44ms616 KiB