結果

問題 No.1811 EQUIV Ten
ユーザー ytftytft
提出日時 2022-02-13 16:22:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,227 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 10,924 KB
実行使用メモリ 106,828 KB
最終ジャッジ日時 2023-09-11 15:34:24
合計ジャッジ時間 16,151 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
29,516 KB
testcase_01 AC 128 ms
29,552 KB
testcase_02 AC 128 ms
29,616 KB
testcase_03 AC 129 ms
29,644 KB
testcase_04 AC 135 ms
29,644 KB
testcase_05 AC 133 ms
29,600 KB
testcase_06 AC 124 ms
29,568 KB
testcase_07 AC 127 ms
29,540 KB
testcase_08 AC 125 ms
29,548 KB
testcase_09 AC 126 ms
29,588 KB
testcase_10 AC 121 ms
29,528 KB
testcase_11 AC 1,035 ms
93,464 KB
testcase_12 AC 1,105 ms
98,528 KB
testcase_13 AC 1,174 ms
104,716 KB
testcase_14 AC 1,227 ms
106,492 KB
testcase_15 AC 1,199 ms
106,828 KB
testcase_16 AC 127 ms
29,584 KB
testcase_17 AC 128 ms
29,588 KB
testcase_18 AC 129 ms
29,756 KB
testcase_19 AC 126 ms
29,592 KB
testcase_20 AC 174 ms
32,680 KB
testcase_21 AC 168 ms
32,448 KB
testcase_22 AC 128 ms
29,628 KB
testcase_23 AC 500 ms
56,000 KB
testcase_24 AC 196 ms
34,676 KB
testcase_25 AC 128 ms
29,788 KB
testcase_26 AC 418 ms
50,396 KB
testcase_27 AC 146 ms
30,440 KB
testcase_28 AC 127 ms
29,524 KB
testcase_29 AC 125 ms
29,532 KB
testcase_30 AC 1,012 ms
91,804 KB
testcase_31 AC 149 ms
31,056 KB
testcase_32 AC 202 ms
35,064 KB
testcase_33 AC 210 ms
35,568 KB
testcase_34 AC 982 ms
88,524 KB
testcase_35 AC 399 ms
49,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
N=int(input())
if N<4:
	print(0)
	exit()
dp=[[1 for i in range(8)] for i in range(N-2)]
ans=1
temp=2
rem=N
mod=10**9+7
for i in range(N-3):
	for j in range(8):
		dp[i+1][j]=(dp[i][j//2]+dp[i][j//2+4])%mod
	dp[i+1][2]=(dp[i+1][2]-dp[i][5]+mod)%mod
while rem:
	if rem%2:
		ans=(ans*temp)%mod
	temp=(temp*temp)%mod
	rem//=2
print((ans-sum(dp[N-3])+mod*8)%mod)
0