結果

問題 No.388 階段 (1)
ユーザー CecilCecil
提出日時 2022-12-19 10:37:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 2,077 ms
コンパイル使用メモリ 71,776 KB
実行使用メモリ 56,096 KB
最終ジャッジ日時 2023-08-11 09:33:40
合計ジャッジ時間 4,969 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,720 KB
testcase_01 AC 119 ms
55,932 KB
testcase_02 AC 119 ms
56,096 KB
testcase_03 AC 120 ms
55,472 KB
testcase_04 AC 120 ms
55,788 KB
testcase_05 AC 118 ms
53,916 KB
testcase_06 AC 121 ms
55,776 KB
testcase_07 AC 120 ms
55,676 KB
testcase_08 AC 120 ms
55,460 KB
testcase_09 AC 120 ms
55,876 KB
testcase_10 AC 122 ms
55,688 KB
testcase_11 AC 122 ms
55,956 KB
testcase_12 AC 122 ms
55,784 KB
testcase_13 AC 120 ms
55,672 KB
testcase_14 AC 119 ms
55,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

		int a = scan.hasNextInt() ? scan.nextInt() : -1;
		int b = scan.hasNextInt() ? scan.nextInt() : -1;
		if (a > 456 || a < 0 || b > 123 || b < 1) {
			System.out.println("入力エラー");
			return;
		}
		
		int step = 0;
		boolean flag = false;
		
	    if(a >= b){
	        step = (a / b) + 1;
	    }else{
	        flag = true;
	    }
		
		step = !flag? step:1;

		// 結果出力
		System.out.println(step);

	}
}
0