結果

問題 No.1824 門\松\列
ユーザー ぷらぷら
提出日時 2022-01-28 21:28:09
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 2,265 ms
コンパイル使用メモリ 199,324 KB
実行使用メモリ 10,676 KB
最終ジャッジ日時 2023-08-28 19:08:56
合計ジャッジ時間 2,772 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
10,676 KB
testcase_01 AC 6 ms
10,636 KB
testcase_02 AC 7 ms
10,548 KB
testcase_03 AC 22 ms
10,576 KB
testcase_04 AC 7 ms
10,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    vector<long long>sum(1000001);
    for(long long i = 1; i <= 1000000; i++) {
        sum[i] = sum[i-1]+i*i-i;
    }
    int T;
    cin >> T;
    while (T--) {
        int N;
        cin >> N;
        cout << sum[N-1]*2 << endl;
    }
}
0