結果

問題 No.557 点対称
ユーザー kohei2019kohei2019
提出日時 2022-02-09 20:46:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 71,588 KB
最終ジャッジ日時 2023-09-07 06:34:16
合計ジャッジ時間 4,456 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,144 KB
testcase_01 AC 74 ms
71,448 KB
testcase_02 AC 76 ms
71,304 KB
testcase_03 AC 75 ms
71,168 KB
testcase_04 AC 75 ms
71,424 KB
testcase_05 AC 74 ms
71,444 KB
testcase_06 AC 76 ms
71,396 KB
testcase_07 AC 75 ms
71,360 KB
testcase_08 AC 76 ms
71,328 KB
testcase_09 AC 75 ms
71,308 KB
testcase_10 AC 74 ms
71,432 KB
testcase_11 AC 75 ms
71,472 KB
testcase_12 AC 76 ms
71,304 KB
testcase_13 AC 74 ms
71,344 KB
testcase_14 AC 75 ms
71,356 KB
testcase_15 AC 74 ms
71,380 KB
testcase_16 AC 76 ms
71,364 KB
testcase_17 AC 74 ms
71,496 KB
testcase_18 AC 75 ms
71,232 KB
testcase_19 AC 75 ms
71,468 KB
testcase_20 AC 75 ms
71,588 KB
testcase_21 AC 74 ms
71,392 KB
testcase_22 AC 77 ms
71,416 KB
testcase_23 AC 75 ms
71,472 KB
testcase_24 AC 74 ms
71,124 KB
testcase_25 AC 75 ms
71,304 KB
testcase_26 AC 74 ms
71,440 KB
testcase_27 AC 74 ms
71,492 KB
testcase_28 AC 74 ms
71,584 KB
testcase_29 AC 75 ms
71,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
mod = 10**9+7
def modPow(a,n,mod):#繰り返し二乗法 a**n % mod
    if n==0:
        return 1
    if n==1:
        return a%mod
    if n & 1:
        return (a*modPow(a,n-1,mod)) % mod
    t = modPow(a,n>>1,mod)
    return (t*t)%mod

if N == 1:
    print(2)
    exit()
ans = 1
if N % 2 == 1:
    ans *= 3
    N -= 1
N //= 2
ans *= 4
N -= 1
ans *= modPow(5,N,mod)
ans %= mod
print(ans)
0