結果
問題 | No.586 ダブルブッキング |
ユーザー |
![]() |
提出日時 | 2017-12-20 02:59:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 261 bytes |
コンパイル時間 | 1,608 ms |
コンパイル使用メモリ | 166,320 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-16 03:01:50 |
合計ジャッジ時間 | 2,150 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
#include<bits/stdc++.h> using namespace std; int A[1001]; int main(){ int a,b,n,x,sum=0; cin >> a >> b >> n; for(int i=0;i<n;i++){ cin >> x; A[x]++; } for(int i=0;i<1000;i++){ if(A[i]>1) sum+=A[i]-1; } cout << sum*(a+b) << endl; return 0; }