結果
| 問題 |
No.586 ダブルブッキング
|
| コンテスト | |
| ユーザー |
data9824
|
| 提出日時 | 2017-11-23 19:17:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 358 bytes |
| コンパイル時間 | 390 ms |
| コンパイル使用メモリ | 55,236 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-27 05:55:54 |
| 合計ジャッジ時間 | 882 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
ソースコード
#include <iostream>
using namespace std;
int main() {
int rooms[1000] = {0};
int p1, p2;
int n;
cin >> p1 >> p2 >> n;
for (size_t i = 0; i < n; ++i) {
int r;
cin >> r;
++rooms[r];
}
int result = 0;
for (size_t i = 0; i < 1000; ++i) {
if (rooms[i] > 1) {
result += (rooms[i] - 1) * (p1 + p2);
}
}
cout << result << endl;
return 0;
}
data9824