結果

問題 No.46 はじめのn歩
ユーザー nihi9119nihi9119
提出日時 2017-05-08 20:14:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 621 bytes
コンパイル時間 4,033 ms
コンパイル使用メモリ 72,808 KB
実行使用メモリ 56,256 KB
最終ジャッジ日時 2023-10-12 19:07:41
合計ジャッジ時間 5,719 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
56,256 KB
testcase_01 AC 127 ms
55,712 KB
testcase_02 AC 125 ms
56,072 KB
testcase_03 AC 126 ms
55,636 KB
testcase_04 AC 130 ms
55,412 KB
testcase_05 AC 129 ms
55,748 KB
testcase_06 AC 129 ms
55,644 KB
testcase_07 AC 128 ms
55,960 KB
testcase_08 AC 129 ms
55,708 KB
testcase_09 AC 128 ms
55,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Question_01_0509 {
	   public static void main(String[] args){
		   Scanner sc = new Scanner(System.in);

		   //入力値
		   int num1 = 0;
		   int num2 = 0;

		   try {
			   num1 = sc.nextInt();
			   num2 = sc.nextInt();
		   } catch (Exception e){
			   //エラーが出たら終了する
			   System.out.println("エラーで終了します。数字を入力して下さい。");
			   System.exit(1);
		   } finally {
			   sc.close();
		   }

		   int result = num2 / num1;
		   if (num2 % num1 != 0){
			   result += 1;
		   }

		   System.out.println(result);
	   }
}
0