結果
| 問題 |
No.586 ダブルブッキング
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2017-08-02 18:14:59 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 139 ms / 2,000 ms |
| コード長 | 555 bytes |
| コンパイル時間 | 2,232 ms |
| コンパイル使用メモリ | 74,788 KB |
| 実行使用メモリ | 41,484 KB |
| 最終ジャッジ日時 | 2024-10-11 05:57:13 |
| 合計ジャッジ時間 | 4,239 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
ソースコード
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int p1 = sc.nextInt();
int p2 = sc.nextInt();
int n = sc.nextInt();
ArrayList<Integer> li = new ArrayList<Integer>();
for(int i = 0 ; i < n ; i++) {
int r = sc.nextInt();
li.add(r);
}
HashSet<Integer> hs = new HashSet<Integer>(li);
int a = n - hs.size();
System.out.println(a * p1 + a * p2);
}
}
No