結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー kuuso1kuuso1
提出日時 2016-11-18 23:00:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 2,077 bytes
コンパイル時間 2,466 ms
コンパイル使用メモリ 113,172 KB
実行使用メモリ 28,772 KB
最終ジャッジ日時 2023-08-17 11:30:09
合計ジャッジ時間 6,089 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
21,680 KB
testcase_01 AC 72 ms
21,740 KB
testcase_02 AC 73 ms
23,568 KB
testcase_03 AC 78 ms
21,864 KB
testcase_04 AC 78 ms
21,772 KB
testcase_05 AC 90 ms
21,740 KB
testcase_06 AC 96 ms
23,764 KB
testcase_07 AC 83 ms
23,792 KB
testcase_08 AC 86 ms
21,632 KB
testcase_09 AC 95 ms
23,956 KB
testcase_10 AC 77 ms
21,732 KB
testcase_11 AC 78 ms
24,032 KB
testcase_12 AC 82 ms
21,736 KB
testcase_13 AC 91 ms
23,772 KB
testcase_14 AC 96 ms
23,768 KB
testcase_15 AC 78 ms
21,764 KB
testcase_16 AC 78 ms
21,588 KB
testcase_17 AC 78 ms
23,744 KB
testcase_18 AC 77 ms
21,540 KB
testcase_19 AC 101 ms
28,772 KB
testcase_20 AC 98 ms
23,892 KB
testcase_21 AC 80 ms
21,848 KB
testcase_22 AC 77 ms
21,700 KB
testcase_23 AC 79 ms
21,704 KB
testcase_24 AC 91 ms
26,000 KB
testcase_25 AC 103 ms
25,808 KB
testcase_26 AC 87 ms
21,788 KB
testcase_27 AC 83 ms
23,792 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		var score = new Dictionary<String,int[]>();
		var lastAC = new Dictionary<String,int>();
		var Inf = (int) 1e9;
		int[] AC = new int[N];
		
		
		for(int i=0;i<T;i++){
			var ss = In[i].Split(' ');
			if(score.ContainsKey(ss[0]) == false){
				score.Add(ss[0],new int[N]);
				lastAC.Add(ss[0],Inf);
			}
			AC[ss[1][0] - 'A']++;
			score[ss[0]][ss[1][0] - 'A'] += (int)(A[ss[1][0] - 'A'] * 50.0 + A[ss[1][0] - 'A'] * 50.0 / (0.8 + 0.2 * AC[ss[1][0] - 'A']));
			lastAC[ss[0]] = i;
		}
		
		List<Pair> P = new List<Pair>();
		
		foreach(var s in score.Keys){
			P.Add(new Pair(s,score[s].Sum(),lastAC[s]));
		}
		
		P.Sort((p,q) => {
			if( p.Score.CompareTo(q.Score) != 0) return - p.Score.CompareTo(q.Score);
			return p.LastAC.CompareTo(q.LastAC);
		});
		
		for(int i=0;i<P.Count;i++){
			Console.WriteLine("{0} {1} {2} {3}",i+1,P[i].Name,String.Join(" ",score[P[i].Name]),P[i].Score);
		}
		
		
		
		
	}
	
	class Pair{
		public String Name;
		public int Score;
		public int LastAC;
		public Pair(String n,int s,int l){
			Name = n; Score = s; LastAC = l;
		}
	}
	
	int N;
	int[] A;
	int T;
	String[] In;
	public Sol(){
		N = ri();
		A = ria();
		T = ri();
		In = new String[T];
		for(int i=0;i<T;i++) In[i] = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
0