結果

問題 No.586 ダブルブッキング
ユーザー misk703misk703
提出日時 2018-06-01 13:00:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 3,506 ms
コンパイル使用メモリ 74,136 KB
実行使用メモリ 56,096 KB
最終ジャッジ日時 2023-09-12 21:17:54
合計ジャッジ時間 5,195 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,680 KB
testcase_01 AC 127 ms
55,584 KB
testcase_02 AC 127 ms
55,872 KB
testcase_03 AC 134 ms
56,096 KB
testcase_04 AC 124 ms
53,952 KB
testcase_05 AC 138 ms
55,604 KB
testcase_06 AC 129 ms
55,668 KB
testcase_07 AC 126 ms
55,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Scanner;


public class No586 {

    public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	int P1 = s.nextInt();
	int P2 = s.nextInt();
	int N = s.nextInt();
	int C = 0;
	ArrayList<Integer> room = new ArrayList<>();

	for(int i=0;i<N;i++){
	    int R = s.nextInt();
	    if(!room.contains(R)){
		room.add(R);
	    }else{
		C += P1 + P2;
	    }
	}
	System.out.println(C);
    }

}
0