結果

問題 No.531 エヌスクミ島の平和協定
ユーザー sakuraigakusakuraigaku
提出日時 2018-10-30 16:28:54
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 3,892 ms
コンパイル使用メモリ 77,608 KB
実行使用メモリ 41,324 KB
最終ジャッジ日時 2024-04-30 00:43:41
合計ジャッジ時間 10,177 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
39,940 KB
testcase_01 AC 134 ms
41,080 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 131 ms
41,088 KB
testcase_05 WA -
testcase_06 AC 137 ms
41,124 KB
testcase_07 AC 135 ms
41,080 KB
testcase_08 AC 131 ms
41,144 KB
testcase_09 AC 135 ms
40,952 KB
testcase_10 AC 133 ms
41,204 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 132 ms
41,324 KB
testcase_14 AC 126 ms
41,000 KB
testcase_15 AC 133 ms
40,952 KB
testcase_16 AC 131 ms
40,936 KB
testcase_17 AC 129 ms
41,148 KB
testcase_18 AC 115 ms
39,632 KB
testcase_19 AC 116 ms
39,748 KB
testcase_20 AC 132 ms
41,188 KB
testcase_21 AC 128 ms
41,004 KB
testcase_22 AC 128 ms
41,284 KB
testcase_23 AC 131 ms
41,032 KB
testcase_24 AC 131 ms
40,948 KB
testcase_25 AC 131 ms
41,268 KB
testcase_26 AC 115 ms
40,016 KB
testcase_27 AC 130 ms
41,140 KB
testcase_28 AC 128 ms
41,044 KB
testcase_29 AC 127 ms
40,924 KB
testcase_30 AC 128 ms
40,904 KB
testcase_31 AC 115 ms
39,824 KB
testcase_32 AC 117 ms
40,056 KB
testcase_33 AC 133 ms
41,272 KB
testcase_34 AC 135 ms
40,840 KB
testcase_35 AC 133 ms
40,980 KB
testcase_36 AC 131 ms
40,840 KB
testcase_37 AC 130 ms
41,056 KB
testcase_38 AC 128 ms
40,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

    import java.util.Scanner;

public class No531 {

	public static void main(String[] args) {
		No531 no531 = new No531();
		no531.mainStart();
	}

	public void mainStart() {
		Scanner sc = new Scanner(System.in);
		String[] nextLines = sc.nextLine().split(" ");
		int animalNumber = Integer.parseInt(nextLines[0]);
		int bootRideNumber = Integer.parseInt(nextLines[1]);
		int ans = logic(animalNumber, bootRideNumber);
		System.out.println(ans);
	}

	public int logic(int animalNumber, int bootRideNumber) {
		if (animalNumber==bootRideNumber) {
			return 1;
		}else if (animalNumber%2==0) {
			if (animalNumber <= bootRideNumber * 2) {
				return 2;
			}
		}else {
			return -1;
		}
		return -1;
	}

}
0