結果
| 問題 |
No.1824 門\松\列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-14 16:41:39 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 359 bytes |
| コンパイル時間 | 336 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 19,444 KB |
| 最終ジャッジ日時 | 2024-07-23 02:33:38 |
| 合計ジャッジ時間 | 1,110 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | AC * 2 RE * 2 |
ソースコード
import sys
sys.setrecursionlimit(10**6)
n = int(input())
t = [int(input()) for i in range(n)]
#print(t)
ans = [0]*(10**6+1)
from functools import lru_cache
@lru_cache(maxsize=10**6+1)
def dfs(x):
if x == 3:
return 4
ans[x] += dfs(x-1)+(x-1)*(x-2)*2
return ans[x]
for i in range(n):
#print(t[i],i)
print(dfs(t[i]))
#print(i)