結果
問題 | No.586 ダブルブッキング |
ユーザー |
|
提出日時 | 2017-11-03 22:52:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 364 bytes |
コンパイル時間 | 1,673 ms |
コンパイル使用メモリ | 168,928 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 16:14:06 |
合計ジャッジ時間 | 2,164 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int p1, p2, N;cin >> p1 >> p2 >> N;int c = 0;vector<int> freq(1000, 0);while (N--){int r;cin >> r;++freq[r];}for (auto & r : freq){if (r > 1){c += (r - 1) * (p1 + p2);}}cout << c << endl;return 0;}