結果
| 問題 | No.586 ダブルブッキング | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-12-15 13:44:39 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 312 bytes | 
| コンパイル時間 | 1,417 ms | 
| コンパイル使用メモリ | 166,196 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-20 01:38:49 | 
| 合計ジャッジ時間 | 1,889 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | AC * 3 WA * 2 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
  int p1, p2;
  cin >> p1 >> p2;
  int N;
  cin >> N;
  int flag[1001];
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (flag[a] >= 1) {
      ans += p1 + p2;
    }
    flag[a]++;
  }
  cout << ans << endl;
  return 0;
}
            
            
            
        