結果
問題 | No.628 Tagの勢い |
ユーザー | No |
提出日時 | 2018-01-05 23:08:06 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 142 ms / 2,000 ms |
コード長 | 1,193 bytes |
コンパイル時間 | 2,043 ms |
コンパイル使用メモリ | 105,980 KB |
実行使用メモリ | 26,140 KB |
最終ジャッジ日時 | 2023-07-29 14:06:00 |
合計ジャッジ時間 | 4,689 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 80 ms
26,056 KB |
testcase_01 | AC | 79 ms
22,112 KB |
testcase_02 | AC | 83 ms
26,140 KB |
testcase_03 | AC | 79 ms
24,032 KB |
testcase_04 | AC | 60 ms
23,132 KB |
testcase_05 | AC | 79 ms
24,220 KB |
testcase_06 | AC | 80 ms
24,104 KB |
testcase_07 | AC | 80 ms
22,096 KB |
testcase_08 | AC | 81 ms
24,088 KB |
testcase_09 | AC | 82 ms
26,072 KB |
testcase_10 | AC | 81 ms
24,132 KB |
testcase_11 | AC | 79 ms
24,116 KB |
testcase_12 | AC | 141 ms
24,120 KB |
testcase_13 | AC | 142 ms
26,104 KB |
testcase_14 | AC | 142 ms
24,220 KB |
testcase_15 | AC | 142 ms
24,220 KB |
testcase_16 | AC | 96 ms
24,140 KB |
testcase_17 | AC | 77 ms
24,012 KB |
testcase_18 | AC | 78 ms
24,136 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; namespace y { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); var d = new SortedDictionary<string, int>(); for (int i = 0; i < n; i++) { Console.ReadLine(); //No string[] ss = Console.ReadLine().Split(); int m = int.Parse(ss[0]); int s = int.Parse(ss[1]); string[] tags = Console.ReadLine().Split(); foreach (var tag in tags) { if (d.ContainsKey(tag)) { d[tag] += s; } else { d.Add(tag, s); } } } int cnt = 0; var ans = d.OrderByDescending((x) => x.Value); foreach (var item in ans) { Console.WriteLine(item.Key + " " + item.Value.ToString()); cnt++; if (cnt == 10) break; } } } }