結果

問題 No.531 エヌスクミ島の平和協定
ユーザー ohagi_1182ohagi_1182
提出日時 2017-06-24 00:05:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 2,351 ms
コンパイル使用メモリ 79,392 KB
実行使用メモリ 41,760 KB
最終ジャッジ日時 2024-04-15 14:30:17
合計ジャッジ時間 8,665 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,416 KB
testcase_01 AC 137 ms
41,320 KB
testcase_02 AC 136 ms
41,172 KB
testcase_03 AC 137 ms
41,468 KB
testcase_04 AC 138 ms
41,352 KB
testcase_05 AC 140 ms
41,592 KB
testcase_06 AC 143 ms
41,304 KB
testcase_07 AC 135 ms
41,592 KB
testcase_08 AC 140 ms
41,656 KB
testcase_09 AC 136 ms
41,760 KB
testcase_10 WA -
testcase_11 AC 135 ms
41,220 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 140 ms
41,220 KB
testcase_15 WA -
testcase_16 AC 138 ms
41,216 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

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 == 2 || m == 2 || (m == 3 && n % m == 2)) {
			minDate = -1;
		} else if (n <= m){
			 minDate = 1;
		} else if (n % m == 0){
			for (int i = 0 ; i < n / m ; i++) {
				minDate++;
			}
		} else if (n % m >= 1) {
			for (int i = 0 ; i < (n / m) + 1 ; i++) {
				minDate++;
			}
		}
		System.out.println(minDate);
	}
}
0