結果
| 問題 | 
                            No.662 スロットマシーン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-03-09 23:08:11 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 877 bytes | 
| コンパイル時間 | 1,030 ms | 
| コンパイル使用メモリ | 75,616 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-10 11:28:02 | 
| 合計ジャッジ時間 | 1,773 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 WA * 10 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#define rep(i, a, n) for(int i = a;i < n;i++)
#define repr(i, a, n) for(int i = a;i > n;i--)
using namespace std;
map<string, int> coin;
int n1, n2, n3;
map<string, int> cnt[3];
string str[5];
void solve(){
	map<string, int> acnt;
	for(auto s : str){
		acnt[s] = 5 * cnt[0][s] * cnt[1][s] * cnt[2][s];
	}
	double e = 0;
	for(auto s : str){
		double u = n1 * n2 * n3;
		e += coin[s] * ((double)acnt[s] / u);
	}
	cout << e << endl;
	for(auto s : str) cout << acnt[s] << endl;
}
int main(){
	rep(i, 0, 5){
		cin >> str[i];
		cin >> coin[str[i]];
	}
	cin >> n1;
	rep(i, 0, n1){
		string s;
		cin >> s;
		cnt[0][s]++;
	}
	cin >> n2;
	rep(i, 0, n2){
		string s;
		cin >> s;
		cnt[1][s]++;
	}
	cin >> n3;
	rep(i, 0, n3){
		string s;
		cin >> s;
		cnt[2][s]++;
	}
	solve();
	return 0;
}