結果

問題 No.531 エヌスクミ島の平和協定
ユーザー htensaihtensai
提出日時 2020-02-13 18:43:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 2,217 ms
コンパイル使用メモリ 74,252 KB
実行使用メモリ 41,532 KB
最終ジャッジ日時 2024-04-15 23:18:07
合計ジャッジ時間 7,806 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
40,360 KB
testcase_01 AC 139 ms
40,316 KB
testcase_02 AC 112 ms
40,188 KB
testcase_03 AC 114 ms
40,168 KB
testcase_04 AC 128 ms
41,324 KB
testcase_05 AC 112 ms
40,124 KB
testcase_06 AC 119 ms
40,740 KB
testcase_07 AC 118 ms
40,796 KB
testcase_08 AC 114 ms
40,076 KB
testcase_09 AC 126 ms
41,320 KB
testcase_10 AC 127 ms
41,264 KB
testcase_11 AC 127 ms
41,172 KB
testcase_12 AC 124 ms
41,448 KB
testcase_13 AC 125 ms
41,304 KB
testcase_14 AC 113 ms
40,252 KB
testcase_15 AC 114 ms
40,036 KB
testcase_16 AC 126 ms
41,532 KB
testcase_17 AC 116 ms
40,840 KB
testcase_18 AC 127 ms
41,516 KB
testcase_19 AC 129 ms
41,176 KB
testcase_20 AC 126 ms
41,116 KB
testcase_21 AC 114 ms
40,440 KB
testcase_22 AC 128 ms
41,456 KB
testcase_23 AC 111 ms
40,032 KB
testcase_24 AC 124 ms
41,300 KB
testcase_25 AC 127 ms
41,432 KB
testcase_26 AC 130 ms
41,048 KB
testcase_27 AC 126 ms
41,232 KB
testcase_28 AC 128 ms
41,296 KB
testcase_29 AC 113 ms
40,420 KB
testcase_30 AC 115 ms
40,288 KB
testcase_31 AC 124 ms
41,156 KB
testcase_32 AC 114 ms
40,444 KB
testcase_33 AC 112 ms
40,388 KB
testcase_34 AC 127 ms
41,320 KB
testcase_35 AC 130 ms
41,112 KB
testcase_36 AC 129 ms
41,216 KB
testcase_37 AC 127 ms
41,180 KB
testcase_38 AC 126 ms
41,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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);
		} else {
		    if (n % 2 == 1 || n / 2 > m) {
		        System.out.println(-1);
		    } else {
		        System.out.println(2);
		    }
		}
   }
}
0