結果
| 問題 |
No.1052 電子機器X
|
| コンテスト | |
| ユーザー |
merom686
|
| 提出日時 | 2020-05-15 21:29:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 361 bytes |
| コンパイル時間 | 984 ms |
| コンパイル使用メモリ | 88,476 KB |
| 最終ジャッジ日時 | 2025-01-10 11:16:00 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;
int main() {
int n, k;
cin >> n >> k;
if (n % 2 == 0) {
cout << min(k + 1, n / 2) << endl;
} else {
cout << min(k + 1, n) << endl;
}
return 0;
}
merom686