結果

問題 No.63 ポッキーゲーム
ユーザー omc-test
提出日時 2016-08-03 16:14:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 470 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 74,744 KB
実行使用メモリ 47,808 KB
最終ジャッジ日時 2024-12-24 05:14:54
合計ジャッジ時間 6,369 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong();
		int k = sc.nextInt();
		sc.close();

		int eat = 0;
		int yuu = 0;
		while(eat < l){
			if(l <= eat + (k*2)) {
				break;
			}
			eat += k*2;
			yuu += k;
		}
		System.out.println(yuu);
	}
}
0