結果

問題 No.662 スロットマシーン
ユーザー ama_nukoama_nuko
提出日時 2018-06-29 17:13:06
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 1,261 bytes
コンパイル時間 1,101 ms
コンパイル使用メモリ 107,892 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 15:13:17
合計ジャッジ時間 2,380 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 4 ms
4,376 KB
testcase_10 AC 4 ms
4,376 KB
testcase_11 AC 4 ms
4,380 KB
testcase_12 AC 4 ms
4,376 KB
testcase_13 AC 4 ms
4,376 KB
testcase_14 AC 4 ms
4,376 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 4 ms
4,376 KB
testcase_18 AC 4 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    vector<string> vs(5);
    map<string, int> ms, toI;
    rep(i, 5){
        int c;
        cin >> vs[i] >> c;
        ms.emplace(vs[i], c);
        toI.emplace(vs[i], i);
    }

    int na, nb, nc;
    vector<int> aa(5), bb(5), cc(5);
    cin >> na;
    vector<string> a(na);
    rep(i, na){
        cin >> a[i];
        aa[toI[a[i]]]++;
    }

    cin >> nb;
    vector<string> b(nb);
    rep(i, nb){
        cin >> b[i];
        bb[toI[b[i]]]++;
    }

    cin >> nc;
    vector<string> c(nc);
    rep(i, nc){
        cin >> c[i];
        cc[toI[c[i]]]++;
    }

    vector<int> ans(6);
    rep(i, 5){
        ans[i] = aa[i] * bb[i] * cc[i] * 5;
        ans[5] += ans[i] * ms[vs[i]];
    }
    cout << fixed << setprecision(3) << (double)ans[5] / (na * nb * nc) << endl;
    rep(i, 5){
        cout << ans[i] << endl;
    }

    return 0;
}
0