結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー oemonoemon
提出日時 2016-11-18 23:59:01
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,805 bytes
コンパイル時間 1,052 ms
コンパイル使用メモリ 108,544 KB
実行使用メモリ 24,704 KB
最終ジャッジ日時 2024-05-04 19:06:40
合計ジャッジ時間 3,249 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
19,712 KB
testcase_01 AC 38 ms
19,584 KB
testcase_02 AC 39 ms
19,328 KB
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 -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var Ls = Console.ReadLine().Split(' ').Select(l => int.Parse(l)).ToArray();
            var T = int.Parse(Console.ReadLine());
            var NamePs = Enumerable.Range(0, T)
                .Select(i => Console.ReadLine().Split(' '))
                .ToArray();

            var results = new Dictionary<string, int[]>();

            var juni = Enumerable.Range(0, N).Select(i => 1).ToArray();
            var update = T;
            foreach (var nameP in NamePs)
            {
                var name = nameP[0];
                var p = (int)(nameP[1][0]) - 65;

                if (!results.ContainsKey(name))
                {
                    results.Add(name, new int[N + 2]);
                }

                results[name][p] = (int)Math.Floor((double)(50 * Ls[p]) + (double)(50 * Ls[p]) / (0.8 + 0.2 * (double)juni[p]));
                results[name][N] = T;
                juni[p]++;
                T--;
            }

            foreach (var result in results)
            {
                result.Value[N + 1] = result.Value.Sum();
            }

            var ordered = results.OrderByDescending(r => r.Value[N + 1]).ThenByDescending(r => r.Value[N]);
            var count = 1;
            foreach (var result in ordered)
            {
                Console.WriteLine(string.Join(" ", new[] {
                    count.ToString(),
                    result.Key,
                    string.Join(" ", result.Value.Take(N)),
                    result.Value.Take(N).Sum().ToString()
                }));
                count++;
            }
        }
    }
}
0