# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
545922 | rainboy | Fibonacci representations (CEOI18_fib) | C11 | 563 ms | 15492 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 Q 100000
#define Q_ (Q * 3)
#define MD 1000000007
unsigned int Z = 12345;
int rand_() {
return (Z *= 3) >> 1;
}
int zz[1 + Q_], ll[1 + Q_], rr[1 + Q_], xx[1 + Q_], xx_[1 + Q_], aa[1 + Q_], bb[1 + Q_], cc[1 + Q_], dd[1 + Q_], aa_[1 + Q_], bb_[1 + Q_], cc_[1 + Q_], dd_[1 + Q_]; char all2[1 + Q_], is2[1 + Q_]; int u_, l_, r_;
int node(int x) {
static int _ = 1;
zz[_] = rand_();
xx_[_] = xx[_] = x;
aa_[_] = aa[_] = (x + 1) / 2, bb_[_] = bb[_] = (x + 1) % 2, cc_[_] = cc[_] = aa[_] - 1, dd_[_] = dd[_] = (x + 1) % 2;
all2[_] = is2[_] = x == 2;
return _++;
}
void pul(int u) {
int l = ll[u], r = rr[u], a, b, c, d;
xx_[u] = xx_[l] + xx[u] + xx_[r];
a = ((long long) aa_[r] * aa[u] + (long long) bb_[r] * cc[u]) % MD;
b = ((long long) aa_[r] * bb[u] + (long long) bb_[r] * dd[u]) % MD;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |