結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
41,548 KB
testcase_01 AC 141 ms
41,292 KB
testcase_02 AC 140 ms
41,032 KB
testcase_03 AC 140 ms
41,148 KB
testcase_04 AC 141 ms
41,064 KB
testcase_05 AC 142 ms
41,176 KB
testcase_06 AC 146 ms
41,448 KB
testcase_07 AC 136 ms
41,004 KB
testcase_08 WA -
testcase_09 AC 144 ms
41,296 KB
testcase_10 AC 137 ms
41,116 KB
testcase_11 AC 138 ms
41,164 KB
testcase_12 AC 136 ms
41,084 KB
testcase_13 AC 134 ms
41,296 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 136 ms
41,168 KB
testcase_17 AC 138 ms
40,952 KB
testcase_18 AC 137 ms
41,156 KB
testcase_19 AC 142 ms
41,388 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 138 ms
41,096 KB
testcase_23 AC 141 ms
41,384 KB
testcase_24 AC 140 ms
41,276 KB
testcase_25 AC 140 ms
40,900 KB
testcase_26 AC 141 ms
41,108 KB
testcase_27 AC 148 ms
41,144 KB
testcase_28 AC 144 ms
41,236 KB
testcase_29 AC 145 ms
41,056 KB
testcase_30 AC 142 ms
41,412 KB
testcase_31 AC 137 ms
41,124 KB
testcase_32 AC 142 ms
41,444 KB
testcase_33 WA -
testcase_34 AC 140 ms
41,392 KB
testcase_35 AC 138 ms
41,328 KB
testcase_36 AC 142 ms
41,148 KB
testcase_37 AC 139 ms
41,024 KB
testcase_38 AC 140 ms
41,184 KB
権限があれば一括ダウンロードができます

ソースコード

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==0){
				System.out.println(n/m);
			}
			else if(n%m>=m){
				System.out.println(n/m);
			}else {
			
			System.out.println(-1);
			
		}
		
		
	}

}
	
}
0