結果
| 問題 |
No.2945 Namiki Secondary School
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-12-02 16:12:34 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 225 bytes |
| コンパイル時間 | 1,762 ms |
| コンパイル使用メモリ | 192,472 KB |
| 最終ジャッジ日時 | 2025-02-26 10:37:03 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 23 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main() {
using ull = unsigned long long;
ull ans = 0, n = 0;
cin >> n;
if (n % 2LL == 0) ans = (n / 2LL) * (n + 1LL);
else ans = n * ((n + 1) / 2);
cout << ans << endl;
}