# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
378455 | rainboy | Fireworks (APIO16_fireworks) | C11 | 112 ms | 184300 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>
#include <string.h>
#define N 5000
#define INF 0x3f3f3f3f3f3f3f3fLL
long long min(long long a, long long b) { return a < b ? a : b; }
int merge(int *dd1, long long *ll1, int k1, int *dd2, long long *ll2, int k2) {
static int dd[N];
static long long ll[N];
int k, h1, h2;
k = 0, h1 = h2 = 0;
while (h1 < k1 && h2 < k2) {
long long l = min(ll1[h1], ll2[h2]);
dd[k] = dd1[h1] + dd2[h2], ll[k] = l, k++;
if ((ll1[h1] -= l) == 0)
h1++;
if ((ll2[h2] -= l) == 0)
h2++;
}
memcpy(dd1, dd, k * sizeof *dd);
memcpy(ll1, ll, k * sizeof *ll);
return k;
}
int main() {
static int pp[N], cc[N], dd[N][N], kk[N];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |