結果

問題 No.662 スロットマシーン
ユーザー 👑 naipianaipia
提出日時 2018-06-06 10:23:42
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 791 bytes
コンパイル時間 1,395 ms
コンパイル使用メモリ 162,528 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 22:41:50
合計ジャッジ時間 2,258 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

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

int main(){
    map<string,long long> a,b,c;
    vector<pair<string,int> > des;
    long long n1,n2,n3,in;
    double ans=0;
    vector<long long> v;
    string s;
    for(int i=0;i<5;i++){cin >> s >> in;des.push_back(make_pair(s,in));}
    cin >> n1;for(int i=0;i<n1;i++){cin >> s;a[s]++;}
    cin >> n2;for(int i=0;i<n2;i++){cin >> s;b[s]++;}
    cin >> n3;for(int i=0;i<n3;i++){cin >> s;c[s]++;}

    for(vector<pair<string,int> >::iterator iter=des.begin();iter!=des.end();iter++){
        v.push_back(a[iter->first]*b[iter->first]*c[iter->first]*5);
        ans+=v.back()*iter->second;
    }
    printf("%f\n",ans/(n1*n2*n3));
    for(vector<long long>::iterator iter=v.begin();iter!=v.end();iter++) cout << *iter << endl;

    return 0;
}
0