結果

問題 No.531 エヌスクミ島の平和協定
ユーザー GrenacheGrenache
提出日時 2017-07-15 11:37:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 753 bytes
コンパイル時間 3,710 ms
コンパイル使用メモリ 75,136 KB
実行使用メモリ 57,756 KB
最終ジャッジ日時 2023-10-19 20:24:34
合計ジャッジ時間 10,359 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,388 KB
testcase_01 AC 136 ms
57,444 KB
testcase_02 AC 132 ms
57,524 KB
testcase_03 AC 133 ms
57,488 KB
testcase_04 AC 133 ms
55,576 KB
testcase_05 AC 133 ms
57,336 KB
testcase_06 AC 133 ms
57,392 KB
testcase_07 AC 133 ms
57,368 KB
testcase_08 AC 136 ms
57,396 KB
testcase_09 AC 132 ms
57,308 KB
testcase_10 AC 133 ms
57,756 KB
testcase_11 AC 129 ms
57,112 KB
testcase_12 AC 133 ms
57,368 KB
testcase_13 AC 133 ms
57,284 KB
testcase_14 AC 135 ms
57,368 KB
testcase_15 AC 132 ms
57,364 KB
testcase_16 AC 132 ms
57,420 KB
testcase_17 AC 132 ms
57,488 KB
testcase_18 AC 134 ms
57,652 KB
testcase_19 AC 137 ms
57,492 KB
testcase_20 AC 135 ms
57,384 KB
testcase_21 AC 134 ms
57,584 KB
testcase_22 AC 135 ms
57,460 KB
testcase_23 AC 135 ms
57,372 KB
testcase_24 AC 137 ms
57,352 KB
testcase_25 AC 135 ms
57,496 KB
testcase_26 AC 135 ms
57,504 KB
testcase_27 AC 135 ms
57,456 KB
testcase_28 AC 134 ms
57,456 KB
testcase_29 AC 134 ms
57,464 KB
testcase_30 AC 137 ms
57,496 KB
testcase_31 AC 134 ms
57,376 KB
testcase_32 AC 136 ms
57,376 KB
testcase_33 AC 136 ms
57,384 KB
testcase_34 AC 135 ms
57,376 KB
testcase_35 AC 134 ms
57,348 KB
testcase_36 AC 137 ms
57,612 KB
testcase_37 AC 137 ms
57,436 KB
testcase_38 AC 135 ms
57,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder531 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();

		if (n % 2 == 0) {
			if (m < n / 2) {
				pr.println(-1);
			} else if (m >= n) {
				pr.println(1);
			} else {
				pr.println(2);
			}
		} else {
			if (m >= n) {
				pr.println(1);
			} else {
				pr.println(-1);
			}
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0