結果

問題 No.586 ダブルブッキング
ユーザー Yut176
提出日時 2018-01-16 17:58:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 909 ms
コンパイル使用メモリ 89,956 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 05:51:36
合計ジャッジ時間 1,484 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;
int mod = 1e9+7;

int main() {
  int p1, p2; cin >> p1 >> p2;
  map<int, int> mp;
  int n; cin >> n;
  int ans = 0;
  for(int i=0; i<n; i++){
    int a; cin >> a;
    if( mp.find(a) == mp.end() ){
      mp[a] = 1;
    }else ans += p1 + p2;
  }
  cout << ans << endl;

  return 0;
}

// EOF
0