| Task: | Peli |
| Sender: | Juho |
| Submission time: | 2022-01-22 15:16:42 +0200 |
| Language: | C++ (C++11) |
| Status: | READY |
| Result: | 11 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 11 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 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 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
| #5 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:8:14: warning: right operand of comma operator has no effect [-Wunused-value]
cin>>n, k;
^Code
#include <bits/stdc++.h>
using namespace std;
int n, k, t[3], vastaus;
char merkki;
int main(){
cin>>n, k;
for(int i=0;i<n;i++){
cin>>merkki;
if(t[merkki-'A']==0){
t[merkki-'A']=1;
if(t[0]+t[1]+t[2]==3){
t[0]=0;
t[1]=0;
t[2]=0;
vastaus++;
}
}
}
cout<<vastaus;
}
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 100000 3 BBAACBCBACBACABBCBAABCBCCBCCAA... |
| correct output |
|---|
| 18201 |
| user output |
|---|
| 18201 |
Test 2
Group: 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 100000 10 BAACABCCBCBAACBBCCCCABBBBACCBA... |
| correct output |
|---|
| 29684 |
| user output |
|---|
| 18249 |
Test 3
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 100000 50 ACAABCBBAAAACCBBABACACACBCAACA... |
| correct output |
|---|
| 32740 |
| user output |
|---|
| 18186 |
Test 4
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 3 1 ABC |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Test 5
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 3 2 ABC |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
