結果
| 問題 |
No.480 合計
|
| コンテスト | |
| ユーザー |
yoshi_k
|
| 提出日時 | 2017-09-10 23:10:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 714 bytes |
| コンパイル時間 | 1,281 ms |
| コンパイル使用メモリ | 157,412 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-14 09:39:58 |
| 合計ジャッジ時間 | 2,095 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i)
#define INF 2000000000
#ifdef LOCAL
#define eprintf(...) fprintf(stdout, __VA_ARGS__)
#else
#define eprintf(...) 0
#endif
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;
int ctoi(char c) {
return c - '0';
}
template <class C>
void printContainer(C &container, const char *delim=",") {
for(const auto &e : container) {
std::cout << e << delim;
}
std::cout << "\n";
}
int main() {
int n;
cin >> n;
//int ans = (n) * (n/2+1) + ((n%2) ? 0 : (n/2));
int ans = (n+1) * n / 2;
cout << ans << endl;
}
yoshi_k