結果
問題 | No.2216 Pa1indr0me |
ユーザー |
![]() |
提出日時 | 2023-04-23 16:36:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 498 bytes |
コンパイル時間 | 290 ms |
コンパイル使用メモリ | 39,936 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 23:33:26 |
合計ジャッジ時間 | 886 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 3 |
ソースコード
/* -*- coding: utf-8 -*- * * 2216.cc: No.2216 Pa1indr0me - yukicoder */ #include<cstdio> #include<algorithm> using namespace std; /* constant */ /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ /* main */ int main() { int tn; scanf("%d", &tn); while (tn--) { int n; scanf("%d", &n); // sigma_{i=1)^n {n*2+1-(i*2-1)} = 2*sigma_{i=1}^n{n+1-i} // = 2*(n(n+1)-n(n+1)/2)=n(n+1) printf("%lld\n", (ll)n * (n + 1)); } return 0; }