Stavo provando a fare il problema cestini, ma quando provo a eseguire il programma con l’input richiesto in output non mi stampa niente.(con i casi di esempio funziona)
#include <iostream>
#include <string>
#include <vector>
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
void solve(int t) {
long long int N, M, Q;
cin >> N >> M >> Q;
string S;
cin >> S;
char cestini[M-1][N-1];
strcpy(cestini[0], S.c_str());
string risposta;
int conto[M-1];
for(int j=0;j<N;j++)
conto[j]=0;
conto[0]=N;
for (int i = 0; i < Q; i++) {
char type;
int a, b;
int k=0;
cin >> type >> a >> b;
if (type == 's') {
cestini[b][conto[b]] =cestini[a][conto[a]-1];
conto[b]++;
conto[a]--;
}
else {
char risp;
risp=cestini[a][b];
risposta=risposta+risp;
}
}
cout << "Case #" << t << ": " << risposta << endl;
}
int main() {
freopen("cestiniinput3.txt", "r", stdin);
freopen("outputcest.txt", "w", stdout);
int T;
cin >> T;
for (int t = 1; t <= T; t++) {
solve(t);
}
return 0;
}