結果
| 問題 | No.586 ダブルブッキング |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-03 22:21:53 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 451µs | |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 802 ms |
| コンパイル使用メモリ | 174,992 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-09-28 05:43:40 |
| 合計ジャッジ時間 | 1,806 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
ソースコード
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int p1,p2;
int n;
int flag[1001];
int main(void){
scanf("%d%d",&p1,&p2);
int ans=0;
scanf("%d",&n);
for(int i=0;i<n;i++){
int a;
scanf("%d",&a);
if(flag[a]>=1){
ans+=p1+p2;
}
flag[a]++;
}
printf("%d\n",ans);
return 0;
}