結果

問題 No.531 エヌスクミ島の平和協定
ユーザー syuki791syuki791
提出日時 2017-07-08 20:58:01
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 2,139 ms
コンパイル使用メモリ 74,268 KB
実行使用メモリ 41,556 KB
最終ジャッジ日時 2024-04-16 06:34:22
合計ジャッジ時間 8,196 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 130 ms
41,172 KB
testcase_02 AC 124 ms
40,848 KB
testcase_03 AC 127 ms
40,868 KB
testcase_04 AC 129 ms
41,016 KB
testcase_05 AC 128 ms
40,964 KB
testcase_06 AC 130 ms
41,120 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 128 ms
41,048 KB
testcase_10 WA -
testcase_11 AC 132 ms
41,064 KB
testcase_12 AC 127 ms
41,296 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 117 ms
40,092 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 s = new Scanner(System.in);
		
		String[] str = s.nextLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int m =Integer.parseInt(str[1]);
		
		if(m>=n){
			System.out.println(1);
					
		}else{
			if(n%m<=m){
				System.out.println(n/m);
			}else {
			
			System.out.println(-1);
			
		}
		
		
	}

}
	
}
0