結果

問題 No.586 ダブルブッキング
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2018-04-14 16:08:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 600 bytes
コンパイル時間 2,908 ms
コンパイル使用メモリ 72,840 KB
実行使用メモリ 56,076 KB
最終ジャッジ日時 2023-09-09 05:11:58
合計ジャッジ時間 4,830 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
56,076 KB
testcase_01 AC 124 ms
55,792 KB
testcase_02 AC 124 ms
55,476 KB
testcase_03 AC 135 ms
55,708 KB
testcase_04 AC 127 ms
56,052 KB
testcase_05 AC 135 ms
55,660 KB
testcase_06 AC 125 ms
55,912 KB
testcase_07 AC 126 ms
56,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        int p1 = sc.nextInt();
        int p2 = sc.nextInt();
        int n = sc.nextInt();
        int count = 0;
        List<Integer> list = new ArrayList<>();
        for(int i = 0 ; i < n; i++) {
            int r = sc.nextInt();
            if(list.contains(r)) {
                count++;
            } else {
                list.add(r);
            }
        }
        System.out.println( count*(p1+p2) );
    }
}
0