Submission #8929

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
89292014-09-26 08:25:15ekzm0204Phibonacci (kriii2_P)C++98
4 / 4
0 ms1088 KiB
#include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
#define pr pair
#define mp make_pair
typedef long long LL;
const LL MOD = 1000000007ll;
class MAT2x2 {
public:
LL dat[2][2];
};
MAT2x2 mult(MAT2x2 a, MAT2x2 b) {
MAT2x2 r;
for (int i=0;i<2;i++) for (int j=0;j<2;j++) r.dat[i][j] = 0;
for (int i=0;i<2;i++) {
for (int j=0;j<2;j++) {
for (int k=0;k<2;k++) {
r.dat[i][j] = (r.dat[i][j] + a.dat[i][k] * b.dat[k][j]) % MOD;
}
}
}
return r;
}
MAT2x2 A, I;
void init() {
A.dat[0][0] = 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...