結果
問題 | No.1052 電子機器X |
ユーザー |
![]() |
提出日時 | 2020-05-15 21:58:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 335 bytes |
コンパイル時間 | 1,430 ms |
コンパイル使用メモリ | 165,208 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 10:22:29 |
合計ジャッジ時間 | 1,983 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) using ll = long long; using P = pair<int,int>; ll ans; int main() { ll n,k;cin >>n >> k; if(k%2 ){ ans = 1+k; } else ans = k+1; if(n%2)ans = min(ans,n); else ans = min(ans,n/2); cout<< ans; return 0; }