結果
| 問題 | No.586 ダブルブッキング | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-02-20 01:23:57 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 348 bytes | 
| コンパイル時間 | 647 ms | 
| コンパイル使用メモリ | 54,232 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-08 18:31:41 | 
| 合計ジャッジ時間 | 1,180 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 5 | 
ソースコード
#include <iostream>
int main(){
    using namespace std;
    int p1,p2,n,r,ans=0;
    bool used[1000];
    for(int i=0;i<1000;i++)used[i]=false;
    cin >> p1 >> p2 >> n;
    for(int i=0;i<n;i++){
        cin >> r;
        if(!used[r])used[r]=true;
        else {
            ans=ans+p1+p2;
        }
    }
    cout << ans << endl;
    return 0;
}
            
            
            
        