이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int l[200010], r[200010], p[200010];
string a;
int dap[200010];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, m, k;
	cin >> n >> m >> a >> k;
	for (int i = 0; i < k; i++)
		cin >> l[i] >> r[i] >> p[i];
	for (int i = 0; i < n; i++) {
		int pos = i;
		for (int y = k - 1; y >= 0; y--) {
			int len = r[y] - l[y];
			if (pos >= p[y] + len)
				pos -= len;
			else if (pos >= p[y]) {
				pos = pos - p[y] + l[y];
			}
		}
		cout << a[pos];
	}
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |