結果
問題 |
No.586 ダブルブッキング
|
ユーザー |
![]() |
提出日時 | 2017-11-10 17:09:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 527 bytes |
コンパイル時間 | 1,401 ms |
コンパイル使用メモリ | 166,300 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 12:03:05 |
合計ジャッジ時間 | 1,849 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 4 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; const int dx[4] ={1,0,-1,0}; const int dy[4] ={0,1,0,-1}; #define Endl endl #define INF 99999999 #define all(v) v.begin(),v.end() #define pb push_back #define mp make_pair #define rep(i,n) for(int i= 0;i<n;i++) int main(){ int p1,p2,n,r; ll ans = 0; bool j[100]; cin >> p1 >>p2; cin >> n; rep(i,n){ cin >>r; if(j[r] == false){ j[r] = true; } else{ ans += p1+p2; } } cout << ans <<Endl; return 0; }