Task: | Peli |
Sender: | xyrj |
Submission time: | 2022-01-22 15:51:44 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#3 | WRONG ANSWER | 0.01 s | 3 | details |
#4 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#5 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:15:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < x.length(); i++) ~~^~~~~~~~~~~~
Code
#include <iostream> using namespace std; int main() { int n, k; string x; cin >> n >> k; cin >> x; int tulos = 0; char nyt = 'A'; for (int i = 0; i < x.length(); i++) { if (x.at(i) == nyt) nyt++; if (nyt == 'D') { tulos++; nyt = 'A'; } } cout << tulos; }
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
100000 3 BBAACBCBACBACABBCBAABCBCCBCCAA... |
correct output |
---|
18201 |
user output |
---|
11122 |
Test 2
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100000 10 BAACABCCBCBAACBBCCCCABBBBACCBA... |
correct output |
---|
29684 |
user output |
---|
11047 |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
100000 50 ACAABCBBAAAACCBBABACACACBCAACA... |
correct output |
---|
32740 |
user output |
---|
11068 |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
3 1 ABC |
correct output |
---|
0 |
user output |
---|
1 |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
3 2 ABC |
correct output |
---|
0 |
user output |
---|
1 |