結果
| 問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
| ユーザー |
bluemegane
|
| 提出日時 | 2018-09-15 19:59:58 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 227 ms / 2,000 ms |
| コード長 | 1,800 bytes |
| コンパイル時間 | 2,159 ms |
| コンパイル使用メモリ | 114,156 KB |
| 実行使用メモリ | 23,936 KB |
| 最終ジャッジ日時 | 2024-07-18 07:11:45 |
| 合計ジャッジ時間 | 5,629 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.Collections.Generic;
using System.Linq;
using System;
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 p = 1;
foreach (var x in d.OrderByDescending(y => y.Value.stotal).ThenBy(y => y.Value.actime))
{
Console.Write("{0} ", p++);
Console.Write("{0} ", x.Key);
for (int i = 0; i < n; i++) Console.Write("{0} ", x.Value.score[i]);
Console.WriteLine("{0}", x.Value.stotal);
}
}
public static int getScore (int[] ac, int[] L , int qno) => 250 * L[qno] / (4 + ac[qno]) + 50 * L[qno];
}
bluemegane