# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
134304 | sebinkim | Fibonacci representations (CEOI18_fib) | C++14 | 675 ms | 81572 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pll;
const ll mod = 1e9 + 7;
struct matrix{
ll aa, ab, ba, bb;
matrix() : aa(1), ab(0), ba(0), bb(1) {}
matrix(ll aa, ll ab, ll ba, ll bb) :
aa(aa), ab(ab), ba(ba), bb(bb) {}
matrix(ll x, ll d)
{
aa = x / 2 % mod; ab = (x - 1) / 2 % mod;
ba = (aa * (d - 1) + 1) % mod;
bb = (ab * (d - 1) + 1) % mod;
}
matrix operator * (matrix m)
{
return matrix((aa * m.aa + ab * m.ba) % mod, (aa * m.ab + ab * m.bb) % mod,
(ba * m.aa + bb * m.ba) % mod, (ba * m.ab + bb * m.bb) % mod);
}
};
struct node{
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... |