結果
問題 | No.586 ダブルブッキング |
ユーザー |
|
提出日時 | 2020-11-28 23:43:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 429 bytes |
コンパイル時間 | 1,623 ms |
コンパイル使用メモリ | 168,600 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 01:41:28 |
合計ジャッジ時間 | 2,131 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i = 0; i < (n); i++)using namespace std;typedef long long ll;int main(){cin.tie(0);ios::sync_with_stdio(0);int p1,p2; cin >> p1 >> p2;int N; cin >> N;vector<int> room(1000, 0);rep(i,N){int r; cin >> r;room[r]++;}ll ans = 0;rep(i,1000) if(room[i] > 0) ans += (room[i] - 1) * (p1 + p2);cout << ans << endl;}