結果
問題 | No.276 連続する整数の和(1) |
ユーザー |
|
提出日時 | 2015-12-07 06:30:45 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 611 bytes |
コンパイル時間 | 583 ms |
コンパイル使用メモリ | 57,368 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 18:09:09 |
合計ジャッジ時間 | 1,230 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
// yukicoder My Practice// author: Leonardone @ NEETSDKASU#include <iostream>#include <algorithm>using namespace std;typedef long long ll;typedef unsigned long long ull;// const ll MD = 1000000007LL;// const ull MD = 1000000007ULL;void solve() {/*a0 = xa1 = a0 + 1 = x + 1a2 = a1 + 1 = x + 2s[3] = x + (x + 1) + (x + 2)s[3] = 3 * x + ns(3 - 1)n * a0 + n * (n - 1) / 2n * (2 * a0 + n - 1) / 2*/ll n;cin >> n;if (n % 2ULL == 0ULL) {n >>= 1;}cout << n << endl;}int main() { solve(); return 0; }