結果

問題 No.1824 門\松\列
ユーザー tktk_snsntktk_snsn
提出日時 2022-01-28 21:45:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 160 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 7,904 KB
最終ジャッジ日時 2023-08-28 19:36:26
合計ジャッジ時間 1,109 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,776 KB
testcase_01 AC 14 ms
7,836 KB
testcase_02 AC 19 ms
7,904 KB
testcase_03 AC 71 ms
7,836 KB
testcase_04 AC 21 ms
7,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def test(K):
    N = K - 2
    return N * (N + 1) + N * (N + 1) * (2 * N + 1) // 3


N = int(input())
for _ in range(N):
    K = int(input())
    print(test(K))
0