結果

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

ソースコード

diff #

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

const int mod=1e9+7;
long modpow(long x, long n)
{
    long res=1;
    while (n>0) {
        if (n%2) res=res*x%mod;
        x=x*x%mod;
        n>>=1;
    }
    return res;
}

int main()
{
    long n; cin>>n;
    long res=4*modpow(5, n/2-1)%mod;
    if (n%2) res=res*3%mod;
    cout<<(n==1 ? 2 : res)<<endl;
}
0