結果

問題 No.63 ポッキーゲーム
ユーザー len_prog
提出日時 2016-06-07 13:11:43
言語 Java
(openjdk 23)
結果
AC  
実行時間 573 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 2,823 ms
コンパイル使用メモリ 74,932 KB
実行使用メモリ 41,648 KB
最終ジャッジ日時 2024-12-24 05:11:20
合計ジャッジ時間 7,520 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long L,K;
		L = scan.nextInt();
		K = scan.nextInt();
		long haruka_length = K;
		long yu_length = K;
		long yu_total = 0;

		while(L >= 0){
			if(L - haruka_length - yu_length <= 0){
				L -= haruka_length;
			}else{
				yu_total += yu_length;
				L = L - haruka_length - yu_length;
			}
		}
		System.out.println(yu_total);
		scan.close();
	}
}
0