結果
問題 | No.586 ダブルブッキング |
ユーザー |
![]() |
提出日時 | 2017-11-03 22:22:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 490 bytes |
コンパイル時間 | 2,244 ms |
コンパイル使用メモリ | 166,384 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 15:51:36 |
合計ジャッジ時間 | 2,161 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long;using ld = long double;#define rep(i,n) for(int i=0;i<(int)(n);i++)#define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++)const ll mod = 1e9 + 7;const int INF = 1e9;int main() {cin.sync_with_stdio(false);int p1, p2;cin >> p1 >> p2;int N;cin >> N;bool r[1000] = {};int ans = 0;rep(i, N) {int R;cin >> R;if (r[R] == true)ans += p1 + p2;else r[R] = true;}cout << ans << endl;return 0;}