結果
| 問題 | 
                            No.557 点対称
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-08-29 18:21:28 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 437 bytes | 
| コンパイル時間 | 1,821 ms | 
| コンパイル使用メモリ | 193,284 KB | 
| 最終ジャッジ日時 | 2025-01-07 15:35:52 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 18 WA * 6 TLE * 6 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int mpow(int a,int b,int m) {
    int ans=1;
    while (b) {
        if (b&1)
            ans=ans*(ll)a%m;
        a=(ll)a*a%m;
        b>>=1;
    }
    return ans;
}
int main() {
    ll n;
    cin>>n;
    if (n==1)
        cout<<3<<endl;
    else {
        int mod=1e9+7;
        int a=n%2?12:4;
        cout<<(ll)a*mpow(5,n/2-1,mod)%mod<<endl;
    }
    return 0;
}