結果

問題 No.1824 門\松\列
ユーザー irumo8202irumo8202
提出日時 2022-01-28 21:41:53
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 260 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 80,444 KB
最終ジャッジ日時 2023-08-28 19:30:54
合計ジャッジ時間 4,167 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

T = int(input())


def solve():
    N = int(input())

    ans = 0
    for i in range(1, N + 1)[::-1]:
        l = max(0, (i - 2) * (i - 1) // 2)
        r = max(0, (i - 2) * (i - 1) // 2)
        ans += l + r
    print(ans * 2)


for _ in range(T):
    solve()
0