結果

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

ソースコード

diff #

#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<<a*mpow(5,n/2-1,mod)%mod<<endl;
    }
    return 0;
}
0