結果

問題 No.557 点対称
ユーザー aaaaaaiu
提出日時 2019-08-29 18:23:39
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 1,884 ms
コンパイル使用メモリ 191,764 KB
最終ジャッジ日時 2025-01-07 15:36:11
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int mpow(int a,ll 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<<2<<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;
}
0