結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー cielciel
提出日時 2016-11-22 01:18:02
言語 Ruby
(3.2.2)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 11,284 KB
実行使用メモリ 17,236 KB
最終ジャッジ日時 2023-08-27 02:40:29
合計ジャッジ時間 4,586 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,064 KB
testcase_01 AC 84 ms
15,244 KB
testcase_02 AC 84 ms
15,316 KB
testcase_03 AC 91 ms
15,436 KB
testcase_04 AC 91 ms
15,356 KB
testcase_05 AC 115 ms
16,972 KB
testcase_06 AC 132 ms
16,500 KB
testcase_07 AC 103 ms
15,756 KB
testcase_08 AC 109 ms
16,044 KB
testcase_09 AC 128 ms
17,128 KB
testcase_10 AC 89 ms
15,288 KB
testcase_11 AC 94 ms
15,372 KB
testcase_12 AC 99 ms
15,676 KB
testcase_13 AC 122 ms
16,304 KB
testcase_14 AC 131 ms
16,960 KB
testcase_15 AC 95 ms
15,532 KB
testcase_16 AC 94 ms
15,456 KB
testcase_17 AC 92 ms
15,148 KB
testcase_18 AC 88 ms
15,168 KB
testcase_19 AC 144 ms
17,080 KB
testcase_20 AC 134 ms
17,236 KB
testcase_21 AC 96 ms
15,432 KB
testcase_22 AC 93 ms
15,356 KB
testcase_23 AC 101 ms
15,420 KB
testcase_24 AC 127 ms
16,424 KB
testcase_25 AC 139 ms
16,840 KB
testcase_26 AC 106 ms
15,820 KB
testcase_27 AC 103 ms
15,640 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

f=->a,b{50*a+250*a/(4+b)}
n=gets.to_i
a=gets.split.map(&:to_i)
h=Hash.new([0,0])
ac=Hash.new(0)
perprob=Hash.new{|h,k|h[k]=[0]*n}
gets.to_i.times{|i|
	x,y=gets.split
	idx=y.ord-65
	score=f.(a[idx],ac[idx]+=1)
	perprob[x][idx]=score
	h[x]=[h[x][0]-score,i]
}
h.sort_by{|k,v|v}.each.with_index{|(k,v),i|
	puts '%d %s %s %d'%[i+1,k,perprob[k]*' ',-v[0]]
}
0