結果

問題 No.1824 門\松\列
ユーザー atjh16atjh16
提出日時 2022-02-03 16:56:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 323 bytes
コンパイル時間 2,704 ms
コンパイル使用メモリ 197,960 KB
実行使用メモリ 7,580 KB
最終ジャッジ日時 2023-09-02 03:19:54
合計ジャッジ時間 6,323 ms
ジャッジサーバーID
(参考情報)
judge11 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int t;
long long n;

int main(){
    cin >> t;
    
    for(int j = 0; j < t; j++){
        cin >> n;
        
        long long m = 0;
        
        for(int i = 0; i < n - 2; i++)
            m += (n - 1 - i) * (n - 2 - i);
        
        cout << m * 2 << endl;
    }
}
0