# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
549454 | rainboy | 복사 붙여넣기 2 (JOI15_copypaste2) | C11 | 129 ms | 8636 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 200000
#define N_ 200
#define Q 200000
int main() {
static char aa[N + 1], bb[N_ + 1];
static int ll[Q], rr[Q], pp[Q], ii[N_];
int n, q, h, i;
scanf("%d%*d%s%d", &n, aa, &q);
for (h = 0; h < q; h++)
scanf("%d%d%d", &ll[h], &rr[h], &pp[h]);
for (i = 0; i < n; i++)
ii[i] = i;
for (h = q - 1; h >= 0; h--)
for (i = 0; i < n; i++)
if (ii[i] >= pp[h] + rr[h] - ll[h])
ii[i] -= rr[h] - ll[h];
else if (ii[i] >= pp[h])
ii[i] += ll[h] - pp[h];
for (i = 0; i < n; i++)
bb[i] = aa[ii[i]];
printf("%s\n", bb);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |