CSES - Datatähti 2022 loppu - Results
Submission details
Task:Järjestys
Sender:cowperso
Submission time:2022-01-22 13:05:04 +0200
Language:C++ (C++11)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.01 sdetails

Code

#include <algorithm>
#include <iostream>

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  uint32_t n;
  std::cin >> n;
  for (uint32_t i = 0; i < n; ++i) {
    std::string jono;
    std::cin >> jono;
    uint32_t ac = std::count(jono.begin(), jono.end(), 'A');
    uint32_t ac2 = std::count(jono.begin() + ac, jono.end(), 'A');
    std::cout << ac2 << '\n';
  }
}

Test details

Test 1

Verdict: ACCEPTED

input
1000
BBAABBBBAAABABBBAABBAABAAAABBB...

correct output
10
10
20
3
20
...

user output
10
10
20
3
20
...
Truncated