結果

問題 No.63 ポッキーゲーム
ユーザー Grenache
提出日時 2015-06-30 20:27:53
言語 Java
(openjdk 23)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 416 bytes
コンパイル時間 3,025 ms
コンパイル使用メモリ 73,952 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-12-24 04:52:15
合計ジャッジ時間 6,535 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder63 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int l = sc.nextInt();
        int k = sc.nextInt();

        if (l % (2 * k) == 0) {
        	System.out.println((l / (2 * k) - 1) * k);
        } else {
        	System.out.println(l / (2 * k) * k);
        }
        
        
        sc.close();
    }
}
0