結果

問題 No.46 はじめのn歩
ユーザー jipo sylphjipo sylph
提出日時 2021-03-04 21:49:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 5,000 ms
コード長 619 bytes
コンパイル時間 2,402 ms
コンパイル使用メモリ 74,688 KB
実行使用メモリ 41,556 KB
最終ジャッジ日時 2024-04-15 13:49:29
合計ジャッジ時間 4,559 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
41,196 KB
testcase_01 AC 140 ms
41,524 KB
testcase_02 AC 140 ms
41,128 KB
testcase_03 AC 144 ms
41,480 KB
testcase_04 AC 141 ms
41,520 KB
testcase_05 AC 140 ms
41,436 KB
testcase_06 AC 139 ms
41,388 KB
testcase_07 AC 138 ms
41,504 KB
testcase_08 AC 141 ms
41,556 KB
testcase_09 AC 139 ms
41,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);

        // int 1つ分を読み込む
        int a = sc.nextInt();

        // int 1つ分を読み込む
        int b = sc.nextInt();

        int hosu = b / a;
        
        if (b % a == 0) {
            System.out.println(hosu);
        } else if (b % a < a) {
            System.out.println(hosu + 1);
        } else {
           // System.out.println(hosu + 1);
        }
    }
}
0