結果

問題 No.388 階段 (1)
ユーザー nihi9119nihi9119
提出日時 2017-05-09 19:54:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 629 bytes
コンパイル時間 3,152 ms
コンパイル使用メモリ 72,908 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-10-12 21:50:48
合計ジャッジ時間 5,954 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,712 KB
testcase_01 AC 124 ms
55,864 KB
testcase_02 AC 124 ms
55,688 KB
testcase_03 AC 124 ms
55,972 KB
testcase_04 AC 125 ms
56,076 KB
testcase_05 AC 127 ms
55,912 KB
testcase_06 AC 126 ms
55,816 KB
testcase_07 AC 124 ms
56,048 KB
testcase_08 AC 124 ms
56,208 KB
testcase_09 AC 123 ms
55,968 KB
testcase_10 AC 124 ms
55,644 KB
testcase_11 AC 124 ms
55,524 KB
testcase_12 AC 122 ms
55,708 KB
testcase_13 AC 126 ms
55,976 KB
testcase_14 AC 125 ms
56,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Question_02_0509_2 {

	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();
			if (num1 >= 0 && num1 <= 456 && num2 >= 1 && num2 <= 123) {
				System.out.println( (num1 / num2) + 1);
			} else {
				System.out.println("制約違反です。 0≤現在居る段数≤456 ,1≤段数≤123");
			}
		} catch (java.util.InputMismatchException e) {
			System.out.println("数値または、整数の範囲内で入力して下さい。");
		} finally {
			sc.close();
		}
	}

}
0