結果

問題 No.662 スロットマシーン
ユーザー phsplsphspls
提出日時 2020-04-16 23:06:12
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,240 bytes
コンパイル時間 2,143 ms
コンパイル使用メモリ 178,904 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 06:03:44
合計ジャッジ時間 3,121 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define llong long long

int main() {
    map<string, int> icon2val;
    vector<string> icons(5);
    rep(i, 5) {
        string icon;
        int val;
        cin >> icon >> val;
        icons[i] = icon;
        icon2val[icon] = val;
    }
    int n1;
    cin >> n1;
    map<string, int> roll1;
    rep(i, 5) roll1[icons[i]] = 0;
    rep(i, n1) {
        string icon;
        cin >> icon;
        roll1[icon] += 1;
    }
    int n2;
    cin >> n2;
    map<string, int> roll2;
    rep(i, 5) roll2[icons[i]] = 0;
    rep(i, n2) {
        string icon;
        cin >> icon;
        roll2[icon] += 1;
    }
    int n3;
    cin >> n3;
    map<string, int> roll3;
    rep(i, 5) roll3[icons[i]] = 0;
    rep(i, n3) {
        string icon;
        cin >> icon;
        roll3[icon] += 1;
    }

    llong summary = 0;
    vector<llong> matchedval(5, 0);
    rep(i, 5) {
        string icon = icons[i];
        int val = icon2val[icon];
        matchedval[i] = 5LL * roll1[icon] * roll2[icon] * roll3[icon];
        summary += matchedval[i] * val;
    }
    printf("%.3f\n", (double)summary / (n1*n2*n3));
    rep(i, 5) cout << matchedval[i] << endl;
}
0