結果

問題 No.1824 門\松\列
ユーザー Akisawa3Akisawa3
提出日時 2022-02-12 22:58:56
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 295 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 92,668 KB
最終ジャッジ日時 2023-09-11 11:36:37
合計ジャッジ時間 3,964 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
80,048 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
from math import factorial

T = int(input())
qs = [int(input()) for _ in range(T)]
mq = max(qs)
s = []
for j in range(3, mq+1):
        p = factorial(j-1) // factorial(j-3)
        s.append(p*2)
accum_s = list(accumulate(s))
for q in qs:
    print(accum_s[q-3])
0