結果

問題 No.586 ダブルブッキング
ユーザー ilplrr
提出日時 2018-02-18 16:19:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 761 ms
コンパイル使用メモリ 56,708 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 15:11:12
合計ジャッジ時間 1,192 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
    int p, pp, n, r[1000] = {}; cin >> p >> pp >> n;

    for (int i = 0; i < n; i++) {
        int t; cin >> t;
        r[t]++;
    }

    int cnt = 0;
    for (auto x : r) if (x > 1) cnt += x - 1;

    cout << cnt * (p + pp) << endl;

    return 0;
}
0