# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
202853 | coloredrabbit | Phibonacci (kriii2_P) | C++17 | 6 ms | 504 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<iostream>
#include<cstring>
#include<cassert>
using namespace std;
using ll = __int128;
const int LIMIT = 126, M = 1e9 + 7;
const ll MOD = (long long)M * M;
struct _mt {
ll m[2][2], t[2][2];
_mt() {
memset(m, 0, sizeof m);
memset(t, 0, sizeof t);
}
void E() { for (int i = 0; i < 2; i++) t[i][i] = m[i][i] = 1; }
_mt operator*(const _mt& o) {
_mt r;
int i, j, k;
for (i = 0; i < 2; i++)for (j = 0; j < 2; j++) for (k = 0; k < 2; k++) {
r.m[i][j] = (r.m[i][j] + m[i][k] * o.m[k][j]) % M;
r.t[i][j] = (r.t[i][j] + t[i][k] * o.t[k][j]) % MOD;
}
return r;
}
}F[LIMIT], NK, K;
ll _pow(ll a, ll n, ll Mod) {
if (n == 1) return a;
ll h = _pow(a, n >> 1, Mod);
return (h * h % Mod) * (n % 2 ? a : 1) % Mod;
}
int main() {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |