結果

問題 No.46 はじめのn歩
ユーザー nihi9119
提出日時 2017-05-08 20:14:44
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 621 bytes
コンパイル時間 3,676 ms
コンパイル使用メモリ 75,084 KB
実行使用メモリ 41,296 KB
最終ジャッジ日時 2024-09-14 17:32:16
合計ジャッジ時間 5,914 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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