結果

問題 No.662 スロットマシーン
ユーザー face4face4
提出日時 2018-06-04 16:56:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 747 bytes
コンパイル時間 803 ms
コンパイル使用メモリ 79,132 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-12 22:11:10
合計ジャッジ時間 1,771 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<map>
using namespace std;

int main(){
    string str[5];
    int coin[5], n[3];
    map<string, int> A[3];
    double a = 0;
    long long u[5];

    for(int i = 0; i < 5; i++){
        cin >> str[i] >> coin[i];
    }

    for(int i = 0; i < 3; i++){
        cin >> n[i];
        for(int j = 0; j < n[i]; j++){
            string s;
            cin >> s;
            A[i][s]++;
        }
    }    

    for(int i = 0; i < 5; i++){
        string s = str[i];
        u[i] = A[0][s] * A[1][s] * A[2][s] * (long long)5;
        a += u[i] * coin[i];
    }

    for(int i = 0; i < 3; i++){
        a /= n[i];
    }

    cout << a << endl;
    for(int i = 0; i < 5; i++){
        cout << u[i] << endl;
    }

    return 0;
}
0