# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
747195 | 2023-05-23T21:36:15 Z | MilosMilutinovic | 복사 붙여넣기 2 (JOI15_copypaste2) | C++14 | 218 ms | 8576 KB |
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; int k, m, n, q, l[N], r[N], c[N]; char s[N]; int main() { scanf("%d%d", &k, &m); scanf("%s", s + 1); n = strlen(s + 1); scanf("%d", &q); for (int i = 1; i <= q; i++) scanf("%d%d%d", &l[i], &r[i], &c[i]), l[i]++; for (int i = 1; i <= k; i++) { int x = i; for (int j = q; j >= 1; j--) { int len = r[j] - l[j] + 1; if (x <= c[j]) continue; if (x > c[j] + len) x -= len; else x = l[j] + (x - c[j] - 1); } printf("%c", s[x]); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 2 ms | 340 KB | Output is correct |
3 | Correct | 2 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 1 ms | 320 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 2 ms | 340 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 2 ms | 340 KB | Output is correct |
3 | Correct | 2 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 1 ms | 320 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 2 ms | 340 KB | Output is correct |
9 | Correct | 196 ms | 8444 KB | Output is correct |
10 | Correct | 82 ms | 8404 KB | Output is correct |
11 | Correct | 87 ms | 8408 KB | Output is correct |
12 | Correct | 218 ms | 8576 KB | Output is correct |
13 | Correct | 80 ms | 8392 KB | Output is correct |
14 | Correct | 79 ms | 8220 KB | Output is correct |
15 | Correct | 82 ms | 8292 KB | Output is correct |
16 | Correct | 88 ms | 8204 KB | Output is correct |
17 | Correct | 191 ms | 8180 KB | Output is correct |
18 | Correct | 65 ms | 8356 KB | Output is correct |
19 | Correct | 65 ms | 8328 KB | Output is correct |
20 | Correct | 66 ms | 8320 KB | Output is correct |
21 | Correct | 70 ms | 8436 KB | Output is correct |
22 | Correct | 81 ms | 8432 KB | Output is correct |
23 | Correct | 134 ms | 8432 KB | Output is correct |
24 | Correct | 119 ms | 8428 KB | Output is correct |
25 | Correct | 161 ms | 8428 KB | Output is correct |
26 | Correct | 206 ms | 8500 KB | Output is correct |