結果

問題 No.63 ポッキーゲーム
ユーザー Gchansanjou
提出日時 2018-02-11 15:11:31
言語 Java
(openjdk 23)
結果
AC  
実行時間 51 ms / 5,000 ms
コード長 745 bytes
コンパイル時間 3,948 ms
コンパイル使用メモリ 75,136 KB
実行使用メモリ 37,240 KB
最終ジャッジ日時 2024-11-16 19:54:19
合計ジャッジ時間 5,016 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukiCoder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No00063 {

	public static void main(String[] args) {
		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

		String[] input = new String[2];

		try {
			input = bufferedReader.readLine().split(" ");

			long length = Long.parseLong(input[0]);
			int eat = Integer.parseInt(input[1]);

			int ans = calculation(length,eat);

			System.out.println(ans);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static int calculation(long length, int eat) {
		int cnt = 0;
		cnt = (int) (length/(eat*2));
		if (length%(eat*2) == 0) {
			cnt--;
		}
		return cnt * eat;
	}

}
0