結果
問題 | No.586 ダブルブッキング |
ユーザー |
![]() |
提出日時 | 2020-05-01 01:17:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 319 bytes |
コンパイル時間 | 1,493 ms |
コンパイル使用メモリ | 169,904 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-21 08:53:11 |
合計ジャッジ時間 | 2,014 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {int p1, p2, n;cin >> p1 >> p2 >> n;int c = 0;vector<int> v(n, 0);for (int i = 0; i < n; i++) {int x;cin >> x;int r = count(v.begin(), v.end(), x);if (r) {c++;}else {v.push_back(x);}}cout << (p1 + p2) * c << endl;}