# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
869785 | rainboy | Treasure (info1cup19_treasure) | C11 | 2 ms | 1060 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 <stdio.h>
#define N 200000
int main() {
static char cc[N + 1];
static int kk[N];
int n, n_, k, i;
scanf("%d%d%s", &n, &k, cc);
n_ = 0;
for (i = 0; i < n; i++) {
cc[n_] = cc[i], kk[n_] = (n_ == 0 || cc[n_ - 1] != cc[i] ? 0 : kk[n_ - 1]) + 1, n_++;
if (kk[n_ - 1] == k)
n_ -= k;
}
cc[n_] = 0;
printf("%s\n", cc);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |