| Task: | Peli |
| Sender: | lain |
| Submission time: | 2022-01-22 14:34:07 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #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 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #5 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
Code
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define vc vector
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define tra(a, x) for (auto &a : x)
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
template <typename... T> void get(T &...args) { ((cin >> args), ...); }
template <typename... T> void pri(T &&...args) { ((cout << args << " "), ...); }
template <typename... T> void pril(T &&...args) {
((cout << args << " "), ...);
cout << '\n';
}
using ll = long long;
using vi = vc<int>;
using vll = vc<ll>;
using pi = pair<int, int>;
const ll LINF = 1e18;
const int INF = 1e9;
const ll mod = 1e9 + 7;
const int N = 1e6 + 1;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, k;
get(n, k);
string s;
get(s);
int ans = 0;
bool c[3];
for (int i = 0; i < n; ++i) {
int idx = s[i] - 'A';
if (!c[idx]) {
c[idx] = true;
}
bool ok = true;
for (int j = 0; j < 3; ++j) {
if (c[j] == false) {
ok = false;
}
}
if (ok) {
ans++;
memset(c, false, sizeof c);
}
}
pril(ans);
}
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 |
|---|
| 18250 |
Test 3
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 100000 50 ACAABCBBAAAACCBBABACACACBCAACA... |
| correct output |
|---|
| 32740 |
| user output |
|---|
| 18186 |
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 |
