結果

問題 No.531 エヌスクミ島の平和協定
ユーザー Amanita2016Amanita2016
提出日時 2017-06-27 21:11:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 2,134 ms
コンパイル使用メモリ 74,212 KB
実行使用メモリ 56,376 KB
最終ジャッジ日時 2024-04-15 14:34:59
合計ジャッジ時間 8,634 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
41,384 KB
testcase_01 AC 134 ms
41,100 KB
testcase_02 AC 134 ms
41,160 KB
testcase_03 AC 138 ms
41,316 KB
testcase_04 AC 138 ms
41,128 KB
testcase_05 AC 137 ms
41,624 KB
testcase_06 AC 137 ms
41,312 KB
testcase_07 AC 135 ms
41,432 KB
testcase_08 AC 132 ms
41,244 KB
testcase_09 AC 134 ms
41,208 KB
testcase_10 WA -
testcase_11 AC 135 ms
41,428 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 133 ms
41,424 KB
testcase_15 WA -
testcase_16 AC 132 ms
41,524 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 #

package yukicoder;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc =  new Scanner(System.in);
		String moment = sc.nextLine();
		String[] spl = moment.split(" ");
		int animal = Integer.parseInt(spl[0]);
		int boat = Integer.parseInt(spl[1]);
		if(animal < 3 || boat < 3){
			System.out.println(-1);
			return;
		}
		int numDay = -1;
		for(int i = boat ; i > 2 ; i--){
			if((animal % i) != 2){
				numDay = animal / i;
				if((animal % i) != 0){
					numDay++;
				}
				break;
			}
		}
		System.out.println(numDay);
	}

}
0