結果
| 問題 |
No.1811 EQUIV Ten
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-01-15 02:46:05 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 572 ms / 2,000 ms |
| コード長 | 426 bytes |
| コンパイル時間 | 132 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-20 20:22:05 |
| 合計ジャッジ時間 | 6,280 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
import sys
input = sys.stdin.readline
mod=10**9+7
N=int(input())
if N<=3:
print(0)
exit()
DP=[1]*8
for i in range(N-3):
NDP=[0]*8
NDP[0]=DP[0]+DP[1]
NDP[1]=DP[2]+DP[3]
NDP[2]=DP[4]
NDP[3]=DP[6]+DP[7]
NDP[4]=DP[0]+DP[1]
NDP[5]=DP[2]+DP[3]
NDP[6]=DP[4]+DP[5]
NDP[7]=DP[6]+DP[7]
for j in range(8):
DP[j]=NDP[j]%mod
print((pow(2,N,mod) - sum(DP))%mod)
titia