結果

問題 No.1052 電子機器X
ユーザー コーヒー太郎
提出日時 2020-05-25 11:36:01
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 28,800 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-13 02:02:38
合計ジャッジ時間 807 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 14 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void){
    int N, K;
    
    scanf("%d %d", &N, &K);
    
   if((N % 2 == 0 && K % 2 == 0) || (N % 2 == 0 && K % 2 != 0)){
       if(N - K * 2 <= 1){
           printf("%d\n", N / 2);
       }else{
           printf("%d\n", K + 1);
       }
       
   }else{
        if(N - K * 2 <= 1){
           printf("%d\n", N);
       }else{
           printf("%d\n", K + 1);
       }
   }
    
    
    return 0;
}
0