結果

問題 No.46 はじめのn歩
ユーザー yamax3232yamax3232
提出日時 2017-02-09 20:12:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 410 bytes
コンパイル時間 3,237 ms
コンパイル使用メモリ 73,284 KB
実行使用メモリ 56,364 KB
最終ジャッジ日時 2023-08-26 22:39:22
合計ジャッジ時間 5,324 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,844 KB
testcase_01 AC 125 ms
56,028 KB
testcase_02 AC 124 ms
55,812 KB
testcase_03 AC 124 ms
55,876 KB
testcase_04 AC 127 ms
56,092 KB
testcase_05 AC 124 ms
55,804 KB
testcase_06 AC 124 ms
56,000 KB
testcase_07 AC 124 ms
55,844 KB
testcase_08 AC 122 ms
56,340 KB
testcase_09 AC 124 ms
56,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class FirstStep {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
Scanner kb=new Scanner(System.in);
int a=kb.nextInt();
int b=kb.nextInt();
double time=(double)b/(double)a;
if((0.5<=time%2&&time%2<1)||(1.5<=time%2&&time%2<2.0)){
time++;
}
else if(b%a!=0){
time++;
}

System.out.printf("%d\n", (int)time);
kb.close();

	}

}
0