結果
| 問題 | No.46 はじめのn歩 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-19 18:10:56 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 56 ms / 5,000 ms |
| + 336µs | |
| コード長 | 808 bytes |
| 記録 | |
| コンパイル時間 | 2,490 ms |
| コンパイル使用メモリ | 85,904 KB |
| 実行使用メモリ | 45,064 KB |
| 最終ジャッジ日時 | 2026-09-08 08:25:19 |
| 合計ジャッジ時間 | 4,612 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
}
}