#include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; typedef long long ll; ll mod=1e9+7; ll ny= 333333336; ll qmi(ll a, ll b) { ll res=1; while (b) { if (b % 2 != 0) { res = res * a % mod; } b/=2; a=a*a%mod; } return res; } int main() { int n;cin>>n; // cout << (qmi(4, n) - 1)*qmi(3,mod-2)%mod; cout << (qmi(4, n) - 1)*ny%mod; return 0; }</algorithm></string></vector></iostream>
点赞

相关推荐

LastWh1spe...:ssob真有些人和那个没睡醒一样
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务