結果

問題 No.557 点対称
ユーザー H3PO4
提出日時 2020-09-24 09:37:40
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-06-28 04:50:28
合計ジャッジ時間 2,095 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
MOD = 1000000007

ans = 1
if N == 1:
    print(2)
    exit()

# 左端: 1,8,6,9のいずれか。0 はNG
ans = 4

# 真ん中
if N % 2:
    ans *= 3

# その他: 0,1,8,6,9 のいずれか。
ans = ans * pow(5, N // 2 - 1, MOD) % MOD
print(ans)
0