結果

問題 No.557 点対称
ユーザー syunsukesyunsuke
提出日時 2019-09-16 11:44:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 275 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 508,568 KB
最終ジャッジ日時 2023-09-21 04:23:23
合計ジャッジ時間 4,345 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
17,780 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
N=(n+1)//2
mod=10**9+7

dp=[[0,0]for i in range(N)]
dp[0][0]=2
dp[0][1]=2

for i in range(1,N):
    dp[i][0]=((dp[i-1][0]+dp[i-1][1])*3)%mod
    dp[i][1]=((dp[i-1][0]+dp[i-1][1])*2)%mod
if n%2==1:
    print(dp[-1][0])
else:
    print((dp[-1][0]+dp[-1][1])%mod)
0