結果
問題 | No.1052 電子機器X |
ユーザー |
![]() |
提出日時 | 2020-05-15 21:36:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 525 bytes |
コンパイル時間 | 1,366 ms |
コンパイル使用メモリ | 157,228 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 08:54:55 |
合計ジャッジ時間 | 1,775 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
/** * @FileName f.cpp * @Author kanpurin * @Created 2020.05.15 21:36:11 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n, k; cin >> n >> k; if (n % 2 == 0) { if (n / 2 - 1 <= k) { cout << n / 2 << endl; } else { cout << k + 1 << endl; } } else { if (k >= n - 1) { cout << n << endl; } else { cout << k + 1 << endl; } } return 0; }