結果

問題 No.662 スロットマシーン
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-20 01:33:59
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 710 bytes
コンパイル時間 2,428 ms
コンパイル使用メモリ 204,188 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 17:08:26
合計ジャッジ時間 3,148 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    map<string,int> des;
    int coins[5];
    for (int i=0;i<5;i++) {
        string s;int c;
        cin>>s>>c;
        des[s]=i;
        coins[i]=c;
    }
    int cnt[3][5]{};
    int n[3];
    for (int i=0;i<3;i++) {
        cin>>n[i];
        for (int j=0;j<n[i];j++) {
            string s;
            cin>>s;
            cnt[i][des[s]]++;
        }
    }
    ll tot=0;
    ll times[5];
    for (int i=0;i<5;i++) {
        times[i]=(ll)cnt[0][i]*cnt[1][i]*cnt[2][i]*5;
        tot+=times[i]*coins[i];
    }
    cout<<fixed<<(double)tot/n[0]/n[1]/n[2]<<endl;
    for (int i=0;i<5;i++) cout<<times[i]<<endl;
    return 0;
}
0