-
Notifications
You must be signed in to change notification settings - Fork 3
/
pygments-issue-1695.cpp
36 lines (36 loc) · 1.11 KB
/
pygments-issue-1695.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include<bits/stdc++.h>
using namespace std;
const int mod=1000000007;
int main(){
long long n;
//n=6;//
cin>>n;
int result_0=1,result_1=0;
int cur_0=0,cur_1=1;
long long temp_0,temp_1,temp_2;
while(n){
if(n&1){
temp_0=(long long)cur_0*result_0;
temp_1=(long long)cur_0*result_1+(long long)cur_1*result_0;
//temp_2=(long long)result_1*result_1;<---------------
temp_2=(long long)cur_1*result_1;
//result_0=(temp_0-temp_2)%mod;<-----------------
//result_1=(temp_1-2*temp_2)%mod;
result_0=(temp_0+temp_2)%mod;
result_1=(temp_1+temp_2)%mod;
}
temp_0=(long long)cur_0*cur_0;
temp_1=(long long)cur_0*cur_1*2;
temp_2=(long long)cur_1*cur_1;
//cur_0=(temp_0-temp_2)%mod;<-----------------
//cur_1=(temp_1-2*temp_2)%mod;
cur_0=(temp_0+temp_2)%mod;
cur_1=(temp_1+temp_2)%mod;
n>>=1;
}
int m11=((result_0*1+/*cur*/result_1*1)%mod+mod)%mod;
int m12=((result_0*0+result_1*1)%mod+mod)%mod;
int m21=((result_0*0+result_1*/*0<-----*/1)%mod+mod)%mod;
int m22=((result_0*1+result_1*/*1<-----*/0)%mod+mod)%mod;
cout<<(long long)(m11*1+m12*0)%mod*(/*m12*0+m22*1<------*/m21*1+m22*0)%mod<<endl;
}