結果
| 問題 | No.628 Tagの勢い | 
| コンテスト | |
| ユーザー |  bluemegane | 
| 提出日時 | 2018-09-10 08:42:15 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 42 ms / 2,000 ms | 
| コード長 | 1,073 bytes | 
| コンパイル時間 | 1,015 ms | 
| コンパイル使用メモリ | 108,160 KB | 
| 実行使用メモリ | 20,352 KB | 
| 最終ジャッジ日時 | 2024-10-07 22:56:19 | 
| 合計ジャッジ時間 | 2,566 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System.Linq;
using System.Collections.Generic;
using System;
public class Hello
{
    public static void Main()
    {
        var d = new Dictionary<string, int>();
        var n = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < n; i++) getDic(d);
        if (d.Count() >= 10)
            foreach (var x in d.OrderByDescending(x => x.Value).ThenBy(x => x.Key).Take(10))
                Console.WriteLine("{0} {1}", x.Key, x.Value);
        else
            foreach (var x in d.OrderByDescending(x => x.Value).ThenBy(x => x.Key))
                Console.WriteLine("{0} {1}", x.Key, x.Value);
    }
    public static void getDic(Dictionary<string, int> d)
    {
        Console.ReadLine().Trim();
        string[] line = Console.ReadLine().Trim().Split(' ');
        var m = int.Parse(line[0]);
        var s = int.Parse(line[1]);
        line = Console.ReadLine().Trim().Split(' ');
        for (int i = 0; i < m; i++)
        {
            var t = line[i];
            if (d.ContainsKey(t)) d[t] += s;
            else d[t] = s;
        }
    }
}
            
            
            
        