結果

問題 No.531 エヌスクミ島の平和協定
ユーザー ohagi_1182ohagi_1182
提出日時 2017-06-23 23:51:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 2,281 ms
コンパイル使用メモリ 74,880 KB
実行使用メモリ 41,856 KB
最終ジャッジ日時 2024-04-15 14:28:53
合計ジャッジ時間 8,888 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
41,736 KB
testcase_01 AC 143 ms
41,488 KB
testcase_02 AC 144 ms
41,808 KB
testcase_03 AC 142 ms
41,600 KB
testcase_04 AC 140 ms
41,204 KB
testcase_05 AC 139 ms
41,256 KB
testcase_06 AC 147 ms
41,504 KB
testcase_07 AC 141 ms
41,548 KB
testcase_08 AC 139 ms
41,296 KB
testcase_09 AC 145 ms
41,516 KB
testcase_10 WA -
testcase_11 AC 139 ms
41,696 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 139 ms
41,352 KB
testcase_15 WA -
testcase_16 AC 140 ms
41,420 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