結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー NoNo
提出日時 2018-01-27 19:00:03
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 323 ms / 2,000 ms
コード長 2,115 bytes
コンパイル時間 2,415 ms
コンパイル使用メモリ 111,008 KB
実行使用メモリ 30,480 KB
最終ジャッジ日時 2023-08-28 09:59:48
合計ジャッジ時間 9,056 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
19,888 KB
testcase_01 AC 73 ms
22,112 KB
testcase_02 AC 72 ms
21,840 KB
testcase_03 AC 104 ms
24,012 KB
testcase_04 AC 100 ms
21,952 KB
testcase_05 AC 232 ms
25,936 KB
testcase_06 AC 218 ms
24,360 KB
testcase_07 AC 214 ms
28,092 KB
testcase_08 AC 162 ms
30,228 KB
testcase_09 AC 266 ms
30,480 KB
testcase_10 AC 88 ms
23,948 KB
testcase_11 AC 118 ms
23,864 KB
testcase_12 AC 123 ms
25,996 KB
testcase_13 AC 227 ms
24,268 KB
testcase_14 AC 311 ms
26,400 KB
testcase_15 AC 127 ms
23,948 KB
testcase_16 AC 85 ms
23,892 KB
testcase_17 AC 113 ms
24,080 KB
testcase_18 AC 80 ms
21,908 KB
testcase_19 AC 249 ms
28,612 KB
testcase_20 AC 300 ms
26,400 KB
testcase_21 AC 123 ms
25,880 KB
testcase_22 AC 127 ms
23,988 KB
testcase_23 AC 156 ms
26,256 KB
testcase_24 AC 291 ms
26,132 KB
testcase_25 AC 323 ms
28,424 KB
testcase_26 AC 205 ms
28,112 KB
testcase_27 AC 193 ms
26,112 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;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] l = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int[] la = new int[n];
            int t = int.Parse(Console.ReadLine());
            var li = new List<Person>();

            int nt = 0;
            for (int i = 0; i < t; i++)
            {
                string[] ss = Console.ReadLine().Split();
                int e = Convert.ToChar(ss[1]) - 'A';
                la[e]++;
                int point = (int)(50 * l[e] + (50 * l[e] / (0.8 + 0.2 * la[e])));


                if (li.Count(x => x.name == ss[0]) == 0)
                {
                    int[] k = new int[n];
                    k[e] = point;
                    var p = new Person(ss[0], k, nt);
                    li.Add(p);
                }
                else
                {
                    var u = li.Where(x => x.name == ss[0]);
                    foreach (var item in u)
                    {
                        item.point[e] = point;
                        item.lastTime = nt;
                    }
                }
                nt++;
            }

            var ans = li.OrderByDescending(x => x.point.Sum()).ThenBy(x => x.lastTime);
            int h = 1;
            foreach (var item in ans)
            {
                string s = "";
                for (int i = 0; i < n; i++)
                {
                    s += item.point[i];
                    if (i != n - 1) s += " ";
                }

                s = h.ToString() + " " + item.name + " " + s + " " + item.point.Sum();
                Console.WriteLine(s);
                h++;
            }
        }
    }

    public class Person
    {
        public Person(string n, int[] p, int t)
        {
            name = n;
            point = p;
            lastTime = t;
        }

        public string name = "";
        public int[] point;
        public int lastTime = 0;
    }
}
0