結果

問題 No.531 エヌスクミ島の平和協定
ユーザー ohagi_1182ohagi_1182
提出日時 2017-06-24 06:59:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 2,443 ms
コンパイル使用メモリ 73,944 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-04-15 14:31:24
合計ジャッジ時間 9,571 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
41,188 KB
testcase_01 AC 143 ms
41,336 KB
testcase_02 AC 142 ms
41,336 KB
testcase_03 AC 145 ms
41,244 KB
testcase_04 AC 142 ms
41,324 KB
testcase_05 AC 158 ms
40,896 KB
testcase_06 AC 146 ms
41,600 KB
testcase_07 AC 144 ms
41,488 KB
testcase_08 WA -
testcase_09 AC 139 ms
41,392 KB
testcase_10 AC 146 ms
41,108 KB
testcase_11 AC 150 ms
41,300 KB
testcase_12 AC 145 ms
41,320 KB
testcase_13 AC 148 ms
41,432 KB
testcase_14 AC 145 ms
41,484 KB
testcase_15 AC 142 ms
41,348 KB
testcase_16 AC 142 ms
41,184 KB
testcase_17 AC 144 ms
41,272 KB
testcase_18 AC 138 ms
41,468 KB
testcase_19 AC 139 ms
41,436 KB
testcase_20 AC 142 ms
41,228 KB
testcase_21 AC 137 ms
41,592 KB
testcase_22 AC 139 ms
40,944 KB
testcase_23 AC 145 ms
41,252 KB
testcase_24 AC 145 ms
41,076 KB
testcase_25 AC 145 ms
41,432 KB
testcase_26 AC 150 ms
41,296 KB
testcase_27 AC 144 ms
41,400 KB
testcase_28 AC 144 ms
41,252 KB
testcase_29 AC 143 ms
41,500 KB
testcase_30 AC 142 ms
41,236 KB
testcase_31 AC 143 ms
41,260 KB
testcase_32 AC 146 ms
41,264 KB
testcase_33 AC 148 ms
41,276 KB
testcase_34 AC 144 ms
41,548 KB
testcase_35 AC 140 ms
41,308 KB
testcase_36 AC 137 ms
41,292 KB
testcase_37 AC 137 ms
41,260 KB
testcase_38 AC 143 ms
41,292 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();
		int minDate = 0;
		if (n <= m) {
			minDate = 1;
		} else if (n % 2 == 1 || (n / 2 > m && n % 2 == 0)) {
			minDate = -1;
		} else if (n / 2 <= m && n % 2 == 0) {
			minDate = n / m;
		}
		System.out.println(minDate);
	}
}
0