結果

問題 No.63 ポッキーゲーム
ユーザー aparachia14aparachia14
提出日時 2016-01-14 22:22:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 416 ms / 5,000 ms
コード長 799 bytes
コンパイル時間 4,182 ms
コンパイル使用メモリ 71,176 KB
実行使用メモリ 49,892 KB
最終ジャッジ日時 2023-08-25 19:02:04
合計ジャッジ時間 6,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
49,276 KB
testcase_01 AC 42 ms
49,308 KB
testcase_02 AC 41 ms
49,348 KB
testcase_03 AC 41 ms
49,160 KB
testcase_04 AC 40 ms
49,168 KB
testcase_05 AC 41 ms
49,512 KB
testcase_06 AC 40 ms
49,108 KB
testcase_07 AC 42 ms
49,400 KB
testcase_08 AC 42 ms
49,336 KB
testcase_09 AC 50 ms
49,132 KB
testcase_10 AC 53 ms
49,560 KB
testcase_11 AC 414 ms
49,624 KB
testcase_12 AC 58 ms
49,548 KB
testcase_13 AC 416 ms
49,892 KB
testcase_14 AC 59 ms
49,724 KB
testcase_15 AC 57 ms
49,600 KB
testcase_16 AC 51 ms
49,548 KB
testcase_17 AC 397 ms
49,740 KB
testcase_18 AC 52 ms
49,616 KB
testcase_19 AC 101 ms
49,752 KB
testcase_20 AC 57 ms
49,736 KB
testcase_21 AC 67 ms
49,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class PockyGame {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		//長さ
		int length;
		//齧るスピード
		int speed;
		//入力値
		String[] input;
		
		//入力待ち
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		input = in.readLine().split(" ");
		length = Integer.parseInt(input[0]);
		speed = Integer.parseInt(input[1]);
		
		int counter = 0;
		while(true){
			//ハルカちゃん
			length = length - speed;
			//ユウちゃん
			if(length - speed > 0){
				length = length - speed;
				counter++;
			}else{
				break;
			}
		}
		
		System.out.println(speed * counter);

	}

}
0