結果

問題 No.662 スロットマシーン
ユーザー nnasennnasen
提出日時 2018-03-10 00:55:18
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 1,152 bytes
コンパイル時間 1,927 ms
コンパイル使用メモリ 173,064 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 07:38:40
合計ジャッジ時間 2,462 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n) - 1; (i) >= 0; --i)
#define SZ(n) (int)(n).size()
#define ALL(n) (n).begin(), (n).end()
#define MOD LL(1e9 + 7)
#define INF 1000000
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PI;

int main() {
    string s[5];
    int coin[5] = {};
    REP(i, 5) 
        cin >> s[i] >> coin[i];
    int n[3];
    map<string, LL> mpa, mpb, mpc;
    REP(i, 3) {
        cin >> n[i];
        REP(j, n[i]) {
            string st;
            cin >> st;
            if (i == 0)
                mpa[st]++;
            if (i == 1)
                mpb[st]++;
            if (i == 2)
                mpc[st]++;
        }
    }
    double ans = 0;
    LL u[5] = {};
    REP(i, 5) {
        u[i] = 1LL * mpa[s[i]] * mpb[s[i]] * mpc[s[i]] * 5;
        ans += u[i] * coin[i];
    }
    REP(i, 3)
        ans /= (double)n[i];
    cout << ans << endl;
    cout << u[0] << endl;
    cout << u[1] << endl;
    cout << u[2] << endl;
    cout << u[3] << endl;
    cout << u[4] << endl;
    return 0;
}
0