結果

問題 No.586 ダブルブッキング
ユーザー jimanojimano
提出日時 2018-01-25 10:45:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 927 bytes
コンパイル時間 3,320 ms
コンパイル使用メモリ 72,616 KB
実行使用メモリ 49,576 KB
最終ジャッジ日時 2023-08-27 05:47:51
合計ジャッジ時間 4,329 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,520 KB
testcase_01 AC 44 ms
49,440 KB
testcase_02 AC 44 ms
49,112 KB
testcase_03 AC 45 ms
49,320 KB
testcase_04 AC 44 ms
49,292 KB
testcase_05 AC 46 ms
49,576 KB
testcase_06 AC 44 ms
49,572 KB
testcase_07 AC 44 ms
49,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

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

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());
			}
			Arrays.sort(reserve);

			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