結果

問題 No.63 ポッキーゲーム
ユーザー リチウム
提出日時 2014-11-11 23:26:47
言語 Java
(openjdk 23)
結果
AC  
実行時間 339 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 4,434 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 41,496 KB
最終ジャッジ日時 2024-12-24 04:41:01
合計ジャッジ時間 7,040 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 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){
				ans+=K;
				L-=K*2;
			}
			else{
				break;
			}
		}
		
		System.out.println(ans);
	}}
0