結果

問題 No.1824 門\松\列
ユーザー 👑 rin204rin204
提出日時 2022-01-28 21:26:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 85,032 KB
最終ジャッジ日時 2023-08-28 19:06:20
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
83,528 KB
testcase_01 AC 78 ms
83,392 KB
testcase_02 AC 98 ms
84,304 KB
testcase_03 AC 136 ms
85,032 KB
testcase_04 AC 97 ms
84,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ans = [0] * (10 ** 6 + 1)
ans[3] = 4
for i in range(4, 10 ** 6 + 1):
    ans[i] = ans[i - 1] + (i - 1) * (i - 2) * 2

def solve():
    n = int(input())
    print(ans[n])
    
    
for _ in range(int(input())):
    solve()
0