結果
| 問題 |
No.1824 門\松\列
|
| コンテスト | |
| ユーザー |
se1ka2
|
| 提出日時 | 2022-01-28 21:28:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 284 bytes |
| コンパイル時間 | 693 ms |
| コンパイル使用メモリ | 65,792 KB |
| 実行使用メモリ | 11,392 KB |
| 最終ジャッジ日時 | 2024-12-30 04:55:52 |
| 合計ジャッジ時間 | 1,315 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 |
ソースコード
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
int main()
{
ll s[1000005];
s[0] = 0;
for(ll i = 1; i <= 1000000; i++){
s[i] = s[i - 1] + i * i - i;
}
int t;
cin >> t;
while(t--){
int n;
cin >> n;
cout << s[n - 1] * 2 << endl;
}
}
se1ka2