結果

問題 No.388 階段 (1)
ユーザー nihi9119
提出日時 2017-05-08 20:31:11
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 717 bytes
コンパイル時間 5,408 ms
コンパイル使用メモリ 74,612 KB
実行使用メモリ 41,344 KB
最終ジャッジ日時 2024-09-14 17:32:45
合計ジャッジ時間 6,415 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 8 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Question_02_0529 {

	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();
		}

		if (num1 < 0 || num1 > 456 || num2 < 1 || num2 > 123){
			System.out.println("制約違反です。 0≤現在居る段数≤456 ,1≤段数≤123");
			System.exit(1);
		}

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

		System.out.println(result);

	}

}
0