結果
| 問題 | No.662 スロットマシーン | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-03-10 00:55:18 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 4 ms / 2,000 ms | 
| コード長 | 1,152 bytes | 
| コンパイル時間 | 1,778 ms | 
| コンパイル使用メモリ | 177,092 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-11 00:17:41 | 
| 合計ジャッジ時間 | 2,579 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n) - 1; (i) >= 0; --i)
#define SZ(n) (int)(n).size()
#define ALL(n) (n).begin(), (n).end()
#define MOD LL(1e9 + 7)
#define INF 1000000
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PI;
int main() {
    string s[5];
    int coin[5] = {};
    REP(i, 5) 
        cin >> s[i] >> coin[i];
    int n[3];
    map<string, LL> mpa, mpb, mpc;
    REP(i, 3) {
        cin >> n[i];
        REP(j, n[i]) {
            string st;
            cin >> st;
            if (i == 0)
                mpa[st]++;
            if (i == 1)
                mpb[st]++;
            if (i == 2)
                mpc[st]++;
        }
    }
    double ans = 0;
    LL u[5] = {};
    REP(i, 5) {
        u[i] = 1LL * mpa[s[i]] * mpb[s[i]] * mpc[s[i]] * 5;
        ans += u[i] * coin[i];
    }
    REP(i, 3)
        ans /= (double)n[i];
    cout << ans << endl;
    cout << u[0] << endl;
    cout << u[1] << endl;
    cout << u[2] << endl;
    cout << u[3] << endl;
    cout << u[4] << endl;
    return 0;
}
            
            
            
        