結果

問題 No.1052 電子機器X
ユーザー beetbeet
提出日時 2020-05-15 21:42:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 522 bytes
コンパイル時間 2,092 ms
コンパイル使用メモリ 200,220 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 12:57:53
合計ジャッジ時間 4,153 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 RE -
testcase_02 AC 2 ms
4,348 KB
testcase_03 RE -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 RE -
testcase_14 AC 2 ms
4,348 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n,k;
  cin>>n>>k;

  if(n&1){
    if(k<=(n+1)/2) cout<<k+1<<newl;
    else cout<<n<<newl;
  }else{
    assert(0);
    if(k<n/2) cout<<k+1<<newl;
    else cout<<n/2<<newl;
  }
  return 0;
}
0