結果
| 問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
| コンテスト | |
| ユーザー |
bluemegane
|
| 提出日時 | 2018-09-15 20:26:54 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,975 bytes |
| コンパイル時間 | 796 ms |
| コンパイル使用メモリ | 115,644 KB |
| 実行使用メモリ | 30,744 KB |
| 最終ジャッジ日時 | 2024-07-18 07:12:24 |
| 合計ジャッジ時間 | 2,659 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 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;
using System.IO;
using System.Text;
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 sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
Console.SetOut(sw);
var p = 1;
var str = new StringBuilder();
foreach (var x in d.OrderByDescending(y => y.Value.stotal).ThenBy(y => y.Value.actime))
{
str.Append ( string.Format("{0} {1} ", p++, x.Key) + string.Join(" ", x.Value.score) + string.Format(" {0}\n", x.Value.stotal));
}
Console.WriteLine(str);
Console.Out.Flush();
}
public static int getScore (int[] ac, int[] L , int qno) => 250 * L[qno] / (4 + ac[qno]) + 50 * L[qno];
}
bluemegane