結果

問題 No.63 ポッキーゲーム
ユーザー リチウムリチウム
提出日時 2014-11-11 23:24:41
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 3,762 ms
コンパイル使用メモリ 74,228 KB
実行使用メモリ 56,252 KB
最終ジャッジ日時 2024-12-31 09:46:15
合計ジャッジ時間 7,970 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class ok{
	public static void main(String[] args) {
		Scanner sc=new Scanner (System.in);
		int L=sc.nextInt();
		int K=sc.nextInt();
		int ans=0;
		while(true){
			if(L>K*2){
				L-=K*2;
				ans+=K;
			}
			else{
				ans+=L;
				break;
			}
		}
		
		System.out.println(ans);
	}}
0