結果
問題 | No.1824 門\松\列 |
ユーザー |
![]() |
提出日時 | 2023-10-26 12:45:44 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 314 bytes |
コンパイル時間 | 2,908 ms |
コンパイル使用メモリ | 242,476 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 12:23:06 |
合計ジャッジ時間 | 3,483 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long;void solve(){ll n;cin>>n;ll ans = n * (n-1) * (2*n-1) / 3 - (n-1) * n;cout<<ans<<endl;}int main(){cin.tie(nullptr);ios::sync_with_stdio(false);int t;cin>>t;while(t--){solve();}}