結果
| 問題 |
No.46 はじめのn歩
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-19 18:10:56 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 117 ms / 5,000 ms |
| コード長 | 808 bytes |
| コンパイル時間 | 3,031 ms |
| コンパイル使用メモリ | 74,456 KB |
| 実行使用メモリ | 41,496 KB |
| 最終ジャッジ日時 | 2024-10-01 22:56:10 |
| 合計ジャッジ時間 | 4,703 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
package yukicoder.beginner.firststep;
import java.util.Scanner;
public class CalcSteps {
public static void main(String[] args) {
new CalcSteps().execute();
}
private void execute() {
CalcStepsDto dto = read();
boolean isJust = dto.length % dto.lengthPerStep == 0;
long steps = dto.length / dto.lengthPerStep;
if(isJust) {
System.out.println(steps);
} else {
System.out.println(steps + 1);
}
}
private CalcStepsDto read() {
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
return new CalcStepsDto(sc.nextLong(), sc.nextLong());
}
private class CalcStepsDto {
private long length;
private long lengthPerStep;
private CalcStepsDto(long lengthPerStep, long length) {
this.lengthPerStep = lengthPerStep;
this.length = length;
}
}
}