129112025-01-03 11:59:38PKBDNS szakaszok száma (75 pont)cpp17Forditási hiba
#include <bits/stdc++.h>
using namespace std;

int main() {
    int dns_length;
    cin >> dns_length;

    string dns;
    cin >> dns;

    int found_dns = 0;

    // Count occurrences of 'T' after each position
    vector<int> count_T(dns_length + 1, 0);  // count_T[i] stores the number of 'T's from index i to the end
    for (int i = dns_length - 1; i >= 0; i--) {
        count_T[i] = count_T[i + 1] + (dns[i] == 'T');
    }

    // Now count 'A' and 'G' pairs
    for (int i = 0; i < dns_length - 2; i++) {
        if (dns[i] == 'A') {
            for (int j = i + 1; j < dns_length - 1; j++) {
                if (dns[j] == 'G') {
                    // For every 'A' and 'G' pair, add the number of 'T's after position j
                    found_dns += count_T[j + 1];
                }
            }
        }
    }

    cout << found_dns-1 << endl;

    return 0
}
Forditási hiba
open /var/local/lib/isolate/434/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:33:13: error: expected ';' before '}' token
   33 |     return 0
      |             ^
      |             ;
   34 | }
      | ~