結果
| 問題 | No.1824 門\松\列 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-14 16:40:54 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 357 bytes |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 89,640 KB |
| 最終ジャッジ日時 | 2024-07-23 02:32:11 |
| 合計ジャッジ時間 | 1,915 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | AC * 2 RE * 2 |
ソースコード
import sys
sys.setrecursionlimit(10**7)
n = int(input())
t = [int(input()) for i in range(n)]
#print(t)
ans = [0]*(10**7+1)
from functools import lru_cache
@lru_cache(maxsize=10**7)
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)