This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int K,M,N;
char S[2010],T[2010];
int main()
{
cin >> K >> M >> S >> N;
for(int i=0; i<N; i++){
int A,B,C;
cin >> A >> B >> C;
for(int j=A; j<B; j++) T[j-A] = S[j];
for(int j=M-B+A-1; j>=C; j--){
S[j+B-A] = S[j];
}
for(int j=C; j<min(M,C+B-A); j++) S[j] = T[j-C];
}
for(int i=0; i<K; i++) cout << S[i];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |