結果
問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
ユーザー |
![]() |
提出日時 | 2018-01-27 19:00:03 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 283 ms / 2,000 ms |
コード長 | 2,115 bytes |
コンパイル時間 | 1,353 ms |
コンパイル使用メモリ | 118,312 KB |
実行使用メモリ | 32,012 KB |
最終ジャッジ日時 | 2024-12-29 06:58:14 |
合計ジャッジ時間 | 6,491 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
コンパイルメッセージ
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()); 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; } }