結果

問題 No.662 スロットマシーン
ユーザー iwkjoseciwkjosec
提出日時 2018-03-16 16:21:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 1,126 bytes
コンパイル時間 3,236 ms
コンパイル使用メモリ 107,736 KB
実行使用メモリ 29,736 KB
最終ジャッジ日時 2023-08-23 11:49:51
合計ジャッジ時間 5,163 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
21,524 KB
testcase_01 AC 69 ms
23,380 KB
testcase_02 AC 71 ms
23,444 KB
testcase_03 AC 73 ms
23,632 KB
testcase_04 AC 70 ms
23,332 KB
testcase_05 AC 69 ms
23,460 KB
testcase_06 AC 70 ms
23,608 KB
testcase_07 AC 72 ms
21,508 KB
testcase_08 AC 76 ms
27,540 KB
testcase_09 AC 79 ms
29,596 KB
testcase_10 AC 80 ms
29,728 KB
testcase_11 AC 79 ms
27,596 KB
testcase_12 AC 80 ms
29,712 KB
testcase_13 AC 80 ms
29,548 KB
testcase_14 AC 79 ms
27,464 KB
testcase_15 AC 79 ms
27,676 KB
testcase_16 AC 70 ms
25,404 KB
testcase_17 AC 79 ms
29,736 KB
testcase_18 AC 80 ms
29,640 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main()
    {
        var s = new string[5];
        var v = new int[5];
        for (int i = 0; i < 5; i++)
        {
            var inp = ReadLine().Split();
            s[i] = inp[0];
            v[i] = int.Parse(inp[1]);
        }

        var n = new long[3];
        var reel = new long[3, 5];
        for (int i = 0; i < 3; i++)
        {
            n[i] = int.Parse(ReadLine());
            for (int j = 0; j < n[i]; j++)
            {
                var g = ReadLine();
                reel[i, s.Select((x, y) => x == g ? y : -1).Where(x => x > -1).First()]++;
            }
        }
        var u = new long[5];
        for (int i = 0; i < 5; i++)
        {
            u[i] = reel[0, i] * reel[1, i] * reel[2, i] * 5;
        }
        var rs = 0L;
        for (int i = 0; i < 5; i++)
        {
            rs += u[i] * v[i];
        }

        WriteLine((double)rs / (n[0] * n[1] * n[2]));
        for (int i = 0; i < 5; i++)
        {
            WriteLine(u[i]);
        }
    }
}
0