Submission #98186

#TimeUsernameProblemLanguageResultExecution timeMemory
98186easrui복사 붙여넣기 2 (JOI15_copypaste2)C++14
10 / 100
9 ms512 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...