結果
| 問題 | No.586 ダブルブッキング | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-06-05 15:55:37 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 435 bytes | 
| コンパイル時間 | 1,257 ms | 
| コンパイル使用メモリ | 157,600 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-30 09:55:24 | 
| 合計ジャッジ時間 | 1,761 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 5 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int p1, p2, n;
int a[1001];
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> p1 >>  p2  >> n;
    int duplicate = 0;
    for (int i = 0; i < n; i++) {
        int t;
        cin >> t;
        if (a[t] == 0)
            a[t] = 1;
        else
            duplicate++;
    }
    cout << duplicate*p1 + duplicate*p2 << endl;
    
}
            
            
            
        