結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー mbanmban
提出日時 2017-01-09 19:19:20
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 3,203 bytes
コンパイル時間 4,458 ms
コンパイル使用メモリ 110,560 KB
実行使用メモリ 32,212 KB
最終ジャッジ日時 2023-08-22 21:53:26
合計ジャッジ時間 8,102 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
24,896 KB
testcase_01 WA -
testcase_02 AC 79 ms
24,884 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;


class Magatro
{
    static int N;
    static int[] L;
    static int T;
    static string[] Name;
    static int[] P;
    const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    static HashSet<string> Hs = new HashSet<string>();
    static void Main()
    {
        Scanner sc = new Scanner();
        N = sc.NextInt();
        L = new int[N];
        for (int i = 0; i < N; i++)
        {
            L[i] = sc.NextInt();
        }
        T = sc.NextInt();
        var D = new Dictionary<string, int>();
        for (int i = 0; i < 26; i++)
        {
            D[ABC[i].ToString()] = i;
        }
        Name = new string[T];
        P = new int[T];
        for (int i = 0; i < T; i++)
        {
            Name[i] = sc.Next();
            Hs.Add(Name[i]);
            P[i] = D[sc.Next()];
        }
        List<string>[] Li = new List<string>[N];
        for(int i = 0; i < N; i++)
        {
            Li[i] = new List<string>(); 
        }
        for(int i = 0; i < T; i++)
        {
            Li[P[i]].Add(Name[i]);
        }
        var H = new Dictionary<string, int[]>();
        foreach(string s in Hs)
        {
            H.Add(s, new int[N]);
        }
        for(int i = 0; i < N; i++)
        {
            for(int j = 0; j < Li[i].Count; j++)
            {
                H[Li[i][j]][i] = Score(j + 1, L[i]);
            }
        }
        SC[] Sc = new SC[Hs.Count];
        int ind = 0;
        foreach(var i in H)
        {
            Sc[ind].Name = i.Key;
            Sc[ind].Score = i.Value.ToArray();
            ind++;
        }
        Array.Sort(Sc, (a, b) => b.Score.Sum().CompareTo(a.Score.Sum()));
        int iii = 1;
 foreach (var s in Sc)
        {
            Console.Write("{1} {0} ", s.Name,iii);
            Console.Write(string.Join(" ",s.Score.Select(ii=>ii.ToString()).ToArray()));
            Console.Write(" {0}",s.Score.Sum());
            Console.WriteLine();
            iii++;
        }
        //Console.WriteLine(Score(1, 2));
    }
    static int Score(int jun,int star)
    {
        return 50 * star + ((500*star) / (8 + 2 * jun));
    }
}
struct SC
{
    public string Name;
    public int[] Score;
    public SC(string name,int N)
    {
        Score = new int[N];
        Name = name;
    }
}
public class Scanner
{
    private string[] S;
    private int Index;
    private char Separator;
    public Scanner(char separator=' ')
    {
        Index = 0;
        Separator = separator;
    }
    public string Next()
    {
        string result;
        if (S == null || Index >= S.Length)
        {
            S = Line();
            Index = 0;
        }
        result = S[Index];
        Index++;
        return result;
    }
    private string[] Line()
    {
        return Console.ReadLine().Split(Separator);
    } 
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
}
0