結果

問題 No.46 はじめのn歩
ユーザー wf4n9wf4n9
提出日時 2017-10-12 17:28:24
言語 Java
(openjdk 23)
結果
AC  
実行時間 885 ms / 5,000 ms
コード長 468 bytes
コンパイル時間 2,787 ms
コンパイル使用メモリ 73,872 KB
実行使用メモリ 41,452 KB
最終ジャッジ日時 2024-11-17 10:52:39
合計ジャッジ時間 5,524 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int oneStep = sc.nextInt();
		int distance = sc.nextInt();

		System.out.println(firstStep(oneStep, distance));

	}

	public static int firstStep(final int oneStep, final int distance) {
		int remainingDistance = distance;
		int steps = 0;
		while (remainingDistance > 0) {
			remainingDistance -= oneStep;
			steps++;
		}
		return steps;
	}
}
0