結果
問題 | No.1824 門\松\列 |
ユーザー | taisii2 |
提出日時 | 2022-01-28 22:25:50 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 299 bytes |
コンパイル時間 | 1,531 ms |
コンパイル使用メモリ | 164,096 KB |
実行使用メモリ | 7,436 KB |
最終ジャッジ日時 | 2023-08-28 20:31:36 |
合計ジャッジ時間 | 5,158 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,380 KB |
testcase_01 | AC | 3 ms
4,380 KB |
testcase_02 | AC | 4 ms
4,376 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int T; cin>>T; while(T--){ long long N; cin>>N; long long ans=0; for(long long i=0;i<2*N;i++){ if(i<N){ ans+=i*(i-2); }else{ ans+=(2*N-i-1)*(2*N-i-1); } } cout<<ans<<endl; } }