結果
| 問題 |
No.662 スロットマシーン
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-09 23:18:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 884 bytes |
| コンパイル時間 | 1,186 ms |
| コンパイル使用メモリ | 90,396 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-10 19:16:55 |
| 合計ジャッジ時間 | 1,839 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <map>
#include <numeric>
using namespace std;
int main() {
map<string, int> pic2idx;
vector<int> coin(5);
string s;
for (int i = 0; i < 5; i++) {
cin >> s >> coin[i];
pic2idx[s] = i;
}
vector<vector<int>> reel(3, vector<int>(5, 0));
vector<int> ns(3);
for (int i = 0; i < 3; i++) {
cin >> ns[i];
for (int j = 0; j < ns[i]; j++) {
cin >> s;
if (pic2idx.count(s) > 0) {
reel[i][pic2idx[s]]++;
}
}
}
vector<long long> U(5, 0);
long long prize = 0;
for (int i = 0; i < 5; i++) {
U[i] = 5LL * reel[0][i] * reel[1][i] * reel[2][i];
prize += U[i] * coin[i];
}
long long total = 1LL * ns[0] * ns[1] * ns[2];
double exp = 1.0 * prize / total;
cout << exp << endl;
for (auto x: U) {
cout << x << endl;
}
return 0;
}