結果
問題 | No.1811 EQUIV Ten |
ユーザー | aaaaaaaaaa2230 |
提出日時 | 2022-01-18 22:36:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 222 ms / 2,000 ms |
コード長 | 338 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 76,160 KB |
最終ジャッジ日時 | 2024-11-23 13:33:25 |
合計ジャッジ時間 | 4,417 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
n = int(input()) mod = 10**9+7 ans = 0 dp = [0]*16 dp[0] = 1 for i in range(n): ndp = [0]*16 for j in range(16): ndp[(j<<1)%16+1] += dp[j] ndp[(j<<1)%16+1] %= mod ndp[(j<<1)%16] += dp[j] ndp[(j<<1)%16] %= mod dp = ndp ans += dp[10]*pow(2,n-1-i,mod) ans %= mod dp[10] = 0 print(ans)