結果

問題 No.586 ダブルブッキング
ユーザー fura
提出日時 2020-03-17 00:41:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 2,893 ms
コンパイル使用メモリ 192,180 KB
最終ジャッジ日時 2025-01-09 07:29:59
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int p1,p2,n; cin>>p1>>p2>>n;

	int ans=0;
	vector<int> cnt(1000);
	rep(i,n){
		int r; cin>>r;
		cnt[r]++;
		if(cnt[r]>1) ans+=p1+p2;
	}
	cout<<ans<<'\n';

	return 0;
}
0