結果

問題 No.46 はじめのn歩
ユーザー kick1128kick1128
提出日時 2021-12-04 16:10:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 602 ms / 5,000 ms
コード長 518 bytes
コンパイル時間 3,347 ms
コンパイル使用メモリ 71,712 KB
実行使用メモリ 56,044 KB
最終ジャッジ日時 2023-09-21 03:43:23
合計ジャッジ時間 5,927 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,888 KB
testcase_01 AC 126 ms
55,364 KB
testcase_02 AC 126 ms
55,576 KB
testcase_03 AC 127 ms
55,412 KB
testcase_04 AC 125 ms
55,892 KB
testcase_05 AC 127 ms
56,044 KB
testcase_06 AC 125 ms
55,788 KB
testcase_07 AC 127 ms
55,924 KB
testcase_08 AC 602 ms
55,544 KB
testcase_09 AC 126 ms
55,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package test;

import java.util.Scanner;

public class Test {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		// 1歩数の距離
        int a = sc.nextInt();
        // 距離
        int b = sc.nextInt();
        sc.close();
        // 歩数
        int count = 0;
        // 歩行距離
        int run = 0;

        // 歩ききるまで何歩かかるか
        while(run < b) {
        	run = run + a;
        	count++;
        }
        System.out.println(count);
	}

}
0