結果

問題 No.557 点対称
ユーザー mban
提出日時 2017-08-12 08:20:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-13 04:24:52
合計ジャッジ時間 1,736 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
mod=1000000007
def pow(a,b):
    result=1
    while b>0:
        if b%2==1:
            result*=a
            result%=mod
        b//=2
        a*=a
        a%=mod
    return result

if n==1:
    anser=2
else:
    k=n//2-1
    anser=(pow(5,k)*4)%mod
    if n%2==1:
        anser*=3
        anser%=mod

print(anser) 
    
0