結果

問題 No.531 エヌスクミ島の平和協定
ユーザー monburan_0401
提出日時 2018-10-06 17:24:21
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 28,416 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 13:51:17
合計ジャッジ時間 1,191 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(void){
    int n;  //  number of animals
    int m;  //  number of ships

    scanf("%d %d",&n,&m);

    if(n <= m){
        printf("1\n");
    }else{
        if(n % 2 == 0 && m >= n/2 + n%2){
            printf("2\n");
        }else{
            printf("-1\n");
        }
    }

    return 0;
}
0