Submission #677432

# Submission time Handle Problem Language Result Execution time Memory
677432 2023-01-03T10:08:46 Z mjhmjh1104 복사 붙여넣기 2 (JOI15_copypaste2) C++17
100 / 100
216 ms 7072 KB
#include <tuple>
#include <cstdio>
#include <vector>
using namespace std;

int k, m, n;
char s[200006];
long long a[200006], b[200006], c[200006];

int main() {
    scanf("%d%d%s%d", &k, &m, s, &n);
    for (int i = 0; i < n; i++) scanf("%lld%lld%lld", a + i, b + i, c + i);
    for (int i = 0; i < k; i++) {
        int t = i;
        for (int j = n - 1; j >= 0; j--) {
            int l = b[j] - a[j];
            if (t < c[j]) ;
            else if (t < c[j] + l) t = a[j] + (t - c[j]);
            else t -= l;
        }
        printf("%c", s[t]);
    }
}

Compilation message

copypaste2.cpp: In function 'int main()':
copypaste2.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d%d%s%d", &k, &m, s, &n);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
copypaste2.cpp:12:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     for (int i = 0; i < n; i++) scanf("%lld%lld%lld", a + i, b + i, c + i);
      |                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 360 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 360 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 304 KB Output is correct
9 Correct 203 ms 6784 KB Output is correct
10 Correct 86 ms 6700 KB Output is correct
11 Correct 81 ms 6760 KB Output is correct
12 Correct 216 ms 6704 KB Output is correct
13 Correct 87 ms 7072 KB Output is correct
14 Correct 86 ms 6860 KB Output is correct
15 Correct 88 ms 6968 KB Output is correct
16 Correct 86 ms 6860 KB Output is correct
17 Correct 187 ms 6848 KB Output is correct
18 Correct 63 ms 6604 KB Output is correct
19 Correct 62 ms 6688 KB Output is correct
20 Correct 66 ms 6744 KB Output is correct
21 Correct 75 ms 6668 KB Output is correct
22 Correct 84 ms 6724 KB Output is correct
23 Correct 92 ms 6740 KB Output is correct
24 Correct 115 ms 6724 KB Output is correct
25 Correct 161 ms 6796 KB Output is correct
26 Correct 210 ms 6812 KB Output is correct