結果

問題 No.63 ポッキーゲーム
ユーザー shinwisteriashinwisteria
提出日時 2017-03-18 20:22:29
言語 Java19
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 307 bytes
コンパイル時間 5,049 ms
コンパイル使用メモリ 71,240 KB
実行使用メモリ 56,040 KB
最終ジャッジ日時 2023-08-25 19:23:20
合計ジャッジ時間 8,020 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,952 KB
testcase_01 AC 125 ms
55,664 KB
testcase_02 AC 124 ms
55,960 KB
testcase_03 AC 126 ms
55,436 KB
testcase_04 AC 127 ms
55,728 KB
testcase_05 AC 125 ms
55,716 KB
testcase_06 AC 126 ms
55,848 KB
testcase_07 AC 124 ms
55,612 KB
testcase_08 AC 125 ms
55,680 KB
testcase_09 AC 124 ms
55,972 KB
testcase_10 AC 124 ms
55,940 KB
testcase_11 AC 124 ms
55,872 KB
testcase_12 AC 126 ms
55,632 KB
testcase_13 AC 122 ms
55,588 KB
testcase_14 AC 122 ms
55,580 KB
testcase_15 AC 123 ms
55,724 KB
testcase_16 AC 122 ms
55,532 KB
testcase_17 AC 124 ms
56,040 KB
testcase_18 AC 125 ms
55,856 KB
testcase_19 AC 125 ms
53,504 KB
testcase_20 AC 125 ms
55,848 KB
testcase_21 AC 125 ms
55,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class PockyGame {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int L = s.nextInt(), K = s.nextInt();
		s.close();
		if(L % (2 * K) == 0){
			System.out.println((L/(2*K)-1) *K);
		}else{
			System.out.println((L/(2*K)) * K);
		}

	}

}
0