# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57145 | gs13105 | 복사 붙여넣기 2 (JOI15_copypaste2) | C++17 | 309 ms | 75020 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <iterator>
using namespace std;
char arr[200010];
int a[200010];
int b[200010];
int c[200010];
int main()
{
//freopen("in", "r", stdin);
//freopen("out", "w", stdout);
int k, m, n, i, j;
scanf("%d%d%s%d", &k, &m, arr + 1, &n);
for(i = 0; i < n; i++)
scanf("%d%d%d", &a[i], &b[i], &c[i]);
for(i = 1; i <= k; i++)
{
int x = i;
for(j = n - 1; j >= 0; j--)
{
if(x >= c[j] + 1)
{
if(x > c[j] + b[j] - a[j])
x -= b[j] - a[j];
else
x = a[j] + x - c[j];
}
}
printf("%c", arr[x]);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |