結果

問題 No.662 スロットマシーン
ユーザー tetsuzuki1115tetsuzuki1115
提出日時 2018-04-26 17:32:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,129 bytes
コンパイル時間 824 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-10 05:36:56
合計ジャッジ時間 2,041 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
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 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    string S[5];
    int C[5];
    for ( int i = 0; i < 5; i++ ) {        
        cin >> S[i] >> C[i];
    }
    int N[3];
    vector< vector<int> > A( 3, vector<int>(5,0) );
    for ( int i = 0; i < 3; i++ ) {        
        cin >> N[i];
        for ( int j = 0; j < N[i]; j++ ) {
            string s;
            cin >> s;
            for ( int k = 0; k < 5; k++ ) {
                if ( S[k] == s ) { A[i][k]++; }
            }
        }
    }


    long long sum = 0;
    for ( int i = 0; i < 5; i++ ) {
        long long a = 1;
        for ( int j = 0; j < 3; j++ ) {
            a *= A[j][i];
        }

        sum += a*5*C[i];
    }

    long long n = 1;
    for ( int i = 0; i < 3; i++ ) {
        n *= N[i];
    }
 
    printf( "%.5f\n", static_cast<double>(sum) / static_cast<double>(n) );


    return 0;
}
0