# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
56881 | 2018-07-13T04:57:03 Z | 김세빈(#1635) | 복사 붙여넣기 2 (JOI15_copypaste2) | C++11 | 235 ms | 106184 KB |
#include <bits/stdc++.h> using namespace std; char str[202020]; int A[202020], B[202020], C[202020]; int K[222]; int n, m, k; int main() { int i, j; scanf("%d%d%s%d", &k, &m, str, &n); for(i=1;i<=n;i++){ scanf("%d%d%d", A+i, B+i, C+i); } for(i=0;i<k;i++) K[i] = i; for(i=n;i>=1;i--){ for(j=0;j<k;j++){ if(K[j] >= C[i]){ if(K[j] >= C[i] - A[i] + B[i]) K[j] -= (B[i] - A[i]); else K[j] -= (C[i] - A[i]); } } } for(i=0;i<k;i++) printf("%c", str[K[i]]); printf("\n"); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 504 KB | Output is correct |
2 | Correct | 5 ms | 748 KB | Output is correct |
3 | Correct | 5 ms | 748 KB | Output is correct |
4 | Correct | 4 ms | 748 KB | Output is correct |
5 | Correct | 5 ms | 868 KB | Output is correct |
6 | Correct | 3 ms | 868 KB | Output is correct |
7 | Correct | 3 ms | 868 KB | Output is correct |
8 | Correct | 4 ms | 880 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 504 KB | Output is correct |
2 | Correct | 5 ms | 748 KB | Output is correct |
3 | Correct | 5 ms | 748 KB | Output is correct |
4 | Correct | 4 ms | 748 KB | Output is correct |
5 | Correct | 5 ms | 868 KB | Output is correct |
6 | Correct | 3 ms | 868 KB | Output is correct |
7 | Correct | 3 ms | 868 KB | Output is correct |
8 | Correct | 4 ms | 880 KB | Output is correct |
9 | Correct | 175 ms | 9196 KB | Output is correct |
10 | Correct | 156 ms | 14912 KB | Output is correct |
11 | Correct | 157 ms | 20816 KB | Output is correct |
12 | Correct | 194 ms | 26692 KB | Output is correct |
13 | Correct | 163 ms | 32276 KB | Output is correct |
14 | Correct | 207 ms | 37732 KB | Output is correct |
15 | Correct | 140 ms | 43292 KB | Output is correct |
16 | Correct | 141 ms | 48540 KB | Output is correct |
17 | Correct | 217 ms | 54000 KB | Output is correct |
18 | Correct | 109 ms | 59732 KB | Output is correct |
19 | Correct | 136 ms | 65656 KB | Output is correct |
20 | Correct | 108 ms | 71328 KB | Output is correct |
21 | Correct | 132 ms | 77464 KB | Output is correct |
22 | Correct | 136 ms | 82960 KB | Output is correct |
23 | Correct | 150 ms | 88736 KB | Output is correct |
24 | Correct | 162 ms | 94704 KB | Output is correct |
25 | Correct | 225 ms | 100380 KB | Output is correct |
26 | Correct | 235 ms | 106184 KB | Output is correct |