結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 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 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 1 ms
4,384 KB
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<long long> > A( 3, vector<long long>(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]++; }
            }
        }
    }

    int X[5] = {0};
    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];
        }
        X[i] = a*5;
        sum += X[i]*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) );
    
    for ( int i = 0; i < 5; i++ ) {
        cout << X[i] << endl;
    }


    return 0;
}
0