CSES - Datatähti 2022 loppu - Results
Submission details
Task:Järjestys
Sender:xyrj
Submission time:2022-01-22 13:09:36 +0200
Language:C++ (C++11)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.01 sdetails

Code

#include <iostream>
#include <algorithm>

using namespace std;

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

    for (int i = 0; i < n; i++)
    {
        string x;
        cin >> x;

        int At = 0;
        for (char c : x)
            if (c == 'A')
                At++;

        int tulos = 0;

        for (int j = 0; j < At; j++)
            if (x.at(j) == 'B')
                tulos++;

        cout << tulos;
    }
}

Test details

Test 1

Verdict:

input
1000
BBAABBBBAAABABBBAABBAABAAAABBB...

correct output
10
10
20
3
20
...

user output
101020320022962282069225231431...
Truncated