結果

問題 No.531 エヌスクミ島の平和協定
ユーザー samplelpmassamplelpmas
提出日時 2017-06-27 14:16:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 2,055 ms
コンパイル使用メモリ 74,244 KB
実行使用メモリ 57,656 KB
最終ジャッジ日時 2023-10-19 20:21:05
合計ジャッジ時間 8,365 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
57,416 KB
testcase_01 AC 131 ms
57,456 KB
testcase_02 AC 129 ms
57,308 KB
testcase_03 AC 130 ms
57,432 KB
testcase_04 AC 128 ms
57,364 KB
testcase_05 AC 128 ms
57,600 KB
testcase_06 AC 129 ms
57,292 KB
testcase_07 AC 134 ms
57,376 KB
testcase_08 AC 132 ms
57,352 KB
testcase_09 AC 130 ms
57,488 KB
testcase_10 AC 129 ms
57,380 KB
testcase_11 AC 128 ms
57,372 KB
testcase_12 AC 126 ms
57,140 KB
testcase_13 AC 131 ms
57,412 KB
testcase_14 AC 132 ms
57,480 KB
testcase_15 AC 134 ms
57,452 KB
testcase_16 AC 132 ms
57,452 KB
testcase_17 AC 130 ms
57,068 KB
testcase_18 AC 130 ms
57,376 KB
testcase_19 AC 128 ms
57,372 KB
testcase_20 AC 132 ms
57,444 KB
testcase_21 AC 126 ms
57,424 KB
testcase_22 AC 128 ms
57,360 KB
testcase_23 AC 131 ms
57,512 KB
testcase_24 AC 130 ms
57,464 KB
testcase_25 AC 129 ms
57,364 KB
testcase_26 AC 129 ms
57,640 KB
testcase_27 AC 128 ms
57,372 KB
testcase_28 AC 130 ms
57,408 KB
testcase_29 AC 129 ms
57,580 KB
testcase_30 AC 129 ms
57,228 KB
testcase_31 AC 128 ms
57,364 KB
testcase_32 AC 130 ms
57,656 KB
testcase_33 AC 131 ms
57,480 KB
testcase_34 AC 130 ms
57,072 KB
testcase_35 AC 130 ms
57,464 KB
testcase_36 AC 130 ms
57,424 KB
testcase_37 AC 130 ms
57,392 KB
testcase_38 AC 130 ms
57,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();

        if (N <= M) {
            System.out.println(1);
            return;
        }

        if (N % 2 == 0 && N / 2 <= M) {
            System.out.println(2);
        } else {
            System.out.println(-1);
        }

    }

}
0