結果
問題 |
No.1052 電子機器X
|
ユーザー |
|
提出日時 | 2020-05-15 22:23:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 340 bytes |
コンパイル時間 | 1,920 ms |
コンパイル使用メモリ | 186,832 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 11:10:19 |
合計ジャッジ時間 | 2,497 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 6 WA * 10 |
ソースコード
#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main(){ int n,k; cin>>n>>k; if(n%2==0){ (k>n/2?k=n/2:k+=0); cout<<(k==n/2?k:(k%2==0?k+1:k-1)); } else{ (k>n/2?k=n/2+1:k+=0); cout<<(k%2==0?2*k+1:2*(k-1)); } }