結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー bluemeganebluemegane
提出日時 2018-09-15 20:21:16
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 1,909 bytes
コンパイル時間 2,398 ms
コンパイル使用メモリ 106,484 KB
実行使用メモリ 24,120 KB
最終ジャッジ日時 2023-09-25 08:46:05
合計ジャッジ時間 6,021 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
19,940 KB
testcase_01 AC 72 ms
21,900 KB
testcase_02 AC 75 ms
21,952 KB
testcase_03 AC 80 ms
24,008 KB
testcase_04 AC 79 ms
23,976 KB
testcase_05 AC 84 ms
20,080 KB
testcase_06 AC 90 ms
23,996 KB
testcase_07 AC 83 ms
22,068 KB
testcase_08 AC 83 ms
23,980 KB
testcase_09 AC 90 ms
21,928 KB
testcase_10 AC 77 ms
21,868 KB
testcase_11 AC 78 ms
22,020 KB
testcase_12 AC 80 ms
23,992 KB
testcase_13 AC 87 ms
23,964 KB
testcase_14 AC 90 ms
24,120 KB
testcase_15 AC 79 ms
22,024 KB
testcase_16 AC 79 ms
22,020 KB
testcase_17 AC 78 ms
22,088 KB
testcase_18 AC 75 ms
22,000 KB
testcase_19 AC 93 ms
24,052 KB
testcase_20 AC 90 ms
24,024 KB
testcase_21 AC 79 ms
22,068 KB
testcase_22 AC 82 ms
22,068 KB
testcase_23 AC 81 ms
22,084 KB
testcase_24 AC 89 ms
24,100 KB
testcase_25 AC 91 ms
24,024 KB
testcase_26 AC 82 ms
21,964 KB
testcase_27 AC 82 ms
22,016 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System.Linq;
using System;
using System.IO;

public class P
{
    public int[] score { get; set; }
    public int stotal { get; set; }
    public int actime { get; set; }
}

public class Hello
{
    public static void Main()
    {
        var ac = new int[26];
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var L = Array.ConvertAll(line, int.Parse);
        var d = new Dictionary<string, P>();
        var t = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < t; i++)
        {
            string[] s = Console.ReadLine().Trim().Split(' ');
            var name = s[0];
            var qno = s[1][0] - 'A';
            ac[qno]++;
            var score = getScore(ac, L, qno);
            if (d.ContainsKey(name))
            {
                d[name].score[qno] = score;
                d[name].stotal += score;
                d[name].actime = i;
            }
            else
            {
                d[name] = new P();
                d[name].score = new int[n];
                d[name].score[qno] = score;
                d[name].stotal = score;
               d[name].actime = i;
            }
        }
            print(d, n);
    }
    public static void print (Dictionary<string,P> d , int n)
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        var p = 1;
        foreach (var x in d.OrderByDescending(y => y.Value.stotal).ThenBy(y => y.Value.actime))
        {
            Console.Write("{0} {1} ", p++,x.Key);
            Console.Write(string.Join(" ", x.Value.score));
            Console.WriteLine(" {0}", x.Value.stotal);
        }
        Console.Out.Flush();
    }
    public static int getScore (int[] ac, int[] L , int qno) => 250 * L[qno] / (4 + ac[qno]) + 50 * L[qno];
}
0