結果

問題 No.586 ダブルブッキング
ユーザー jimanojimano
提出日時 2018-01-25 10:43:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 877 bytes
コンパイル時間 5,862 ms
コンパイル使用メモリ 72,136 KB
実行使用メモリ 49,468 KB
最終ジャッジ日時 2023-08-27 05:47:00
合計ジャッジ時間 5,889 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,468 KB
testcase_01 AC 44 ms
49,404 KB
testcase_02 AC 44 ms
47,356 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 46 ms
49,196 KB
testcase_06 AC 44 ms
49,096 KB
testcase_07 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

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

public class No0586 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			int yukiPrice = Integer.parseInt(br.readLine());
			int furikaePrice = Integer.parseInt(br.readLine());
			int cntReserve = Integer.parseInt(br.readLine());
			int cntDupulicate = 0;
			int[] reserve = new int[cntReserve];

			for (int i = 0; i < reserve.length; i++) {
				reserve[i] = Integer.parseInt(br.readLine());
			}

			for (int i = 0; i < reserve.length - 1; i++) {
				cntDupulicate = (reserve[i] == reserve[i + 1]) ? cntDupulicate + 1
						: cntDupulicate;
			}
			System.out.println((yukiPrice + furikaePrice) * cntDupulicate);

		}
		catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0