結果
| 問題 | No.276 連続する整数の和(1) |
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2016-01-24 20:57:57 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 307 bytes |
| 記録 | |
| コンパイル時間 | 315 ms |
| コンパイル使用メモリ | 75,580 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-04-09 21:43:28 |
| 合計ジャッジ時間 | 1,063 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
if(n == 1 || n == 2) {
cout << 1 << endl;
}
else if(n % 2 == 0) {
cout << n / 2 << endl;
}
else {
cout << n << endl;
}
}
femto