結果

問題 No.63 ポッキーゲーム
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-05 11:00:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 400 bytes
コンパイル時間 5,101 ms
コンパイル使用メモリ 71,868 KB
実行使用メモリ 56,632 KB
最終ジャッジ日時 2023-09-20 20:33:16
合計ジャッジ時間 7,804 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,760 KB
testcase_01 AC 119 ms
56,060 KB
testcase_02 AC 119 ms
56,408 KB
testcase_03 AC 120 ms
55,704 KB
testcase_04 AC 120 ms
55,884 KB
testcase_05 AC 120 ms
55,920 KB
testcase_06 AC 119 ms
53,800 KB
testcase_07 AC 121 ms
55,752 KB
testcase_08 AC 120 ms
55,972 KB
testcase_09 AC 121 ms
56,132 KB
testcase_10 AC 121 ms
55,492 KB
testcase_11 AC 122 ms
56,028 KB
testcase_12 AC 121 ms
55,688 KB
testcase_13 AC 122 ms
55,648 KB
testcase_14 AC 119 ms
55,768 KB
testcase_15 AC 135 ms
55,500 KB
testcase_16 AC 130 ms
55,688 KB
testcase_17 AC 122 ms
54,444 KB
testcase_18 AC 123 ms
56,632 KB
testcase_19 AC 122 ms
56,064 KB
testcase_20 AC 123 ms
56,004 KB
testcase_21 AC 123 ms
56,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No63 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int L = sc.nextInt(); // ポッキーの長さ
		int K = sc.nextInt(); // 一回で食べる長さ
		int Y; // ユウちゃんが食べる回数
		
		if(L % (2 * K) == 0) {
			Y = ((L / K) - 2) / 2;
		}else {
			Y = L / (2 * K);
		}
		
		System.out.println(Y * K);
	}
}
0