CSES - Datatähti 2022 loppu - Results
Submission details
Task:Peli
Sender:Mahtimursu
Submission time:2022-01-22 16:38:00 +0200
Language:C++ (C++17)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:34:13: error: 'handle' was not declared in this scope
             handle(ac, bc, cc);
             ^~~~~~
input/code.cpp:34:13: note: suggested alternative: 'rand_r'
             handle(ac, bc, cc);
             ^~~~~~
             rand_r
input/code.cpp:37:13: error: 'handle' was not declared in this scope
             handle(bc, ac, cc);
             ^~~~~~
input/code.cpp:37:13: note: suggested alternative: 'rand_r'
             handle(bc, ac, cc);
             ^~~~~~
             rand_r
input/code.cpp:40:13: error: 'handle' was not declared in this scope
             handle(cc, ac, bc);
             ^~~~~~
input/code.cpp:40:13: note: suggested alternative: 'rand_r'
             handle(cc, ac, bc);
             ^~~~~~
             rand_r

Code

#include <bits/stdc++.h>

typedef long long ll;

#define M 1000000007
#define N (1 << 18)

using namespace std;

int n, k;
int ans = 0;

int dp[100001][10][10][10];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    string v;
    cin >> n >> k;
    cin >> v;

    if (k < 3 || n < 3) {
        cout << 0 << "\n";
        return 0;
    }

    
    int ac = 0;
    int bc = 0;
    int cc = 0;
    for (int i = 0; i < n; ++i) {
        if (v[i] == 'A') {
            handle(ac, bc, cc);
        }
        if (v[i] == 'B') {
            handle(bc, ac, cc);
        }
        if (v[i] == 'C') {
            handle(cc, ac, bc);
        }
        cout << ac << ", " << bc << ", " << cc << endl;
    }

    cout << ans << "\n";

    return 0;
}