結果
| 問題 | No.586 ダブルブッキング | 
| コンテスト | |
| ユーザー |  keisuke6 | 
| 提出日時 | 2022-10-22 16:35:42 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 15 ms / 2,000 ms | 
| コード長 | 269 bytes | 
| コンパイル時間 | 1,730 ms | 
| コンパイル使用メモリ | 197,140 KB | 
| 最終ジャッジ日時 | 2025-02-08 11:25:26 | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 5 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int A,B,Q;
  cin>>A>>B>>Q;
  set<int> s;
  int ans = 0;
  for(int i=0;i<Q;i++){
      int a;
      cin>>a;
      if(s.count(a)) ans += A+B;
      s.insert(a);
  }
  cout<<ans<<endl;
}
            
            
            
        