結果

問題 No.63 ポッキーゲーム
ユーザー aaaaasatori
提出日時 2018-02-05 11:00:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 104 ms / 5,000 ms
コード長 400 bytes
コンパイル時間 2,830 ms
コンパイル使用メモリ 74,912 KB
実行使用メモリ 41,512 KB
最終ジャッジ日時 2024-07-06 15:22:14
合計ジャッジ時間 6,054 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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