Submission #677376

#TimeUsernameProblemLanguageResultExecution timeMemory
677376Cross_Ratio복사 붙여넣기 2 (JOI15_copypaste2)C++14
100 / 100
190 ms3060 KiB
#include <bits/stdc++.h> using namespace std; int A[200005]; int B[200005]; int C[200005]; signed main() { cin.sync_with_stdio(false); cin.tie(0); cout.tie(0); int K, M; cin >> K >> M; string s; cin >> s; int N; cin >> N; int i, j; for(i=0;i<N;i++) cin >> A[i] >> B[i] >> C[i]; for(i=0;i<K;i++) { int pt = i; for(j=N-1;j>=0;j--) { if(C[j] <= pt) { int len = B[j] - A[j]; if(pt >= C[j] + len) { pt -= len; } else { pt += A[j] - C[j]; } } } //cout << pt << ' '; cout << s[pt]; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...