結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー cielciel
提出日時 2016-11-22 01:07:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 11,540 KB
実行使用メモリ 17,168 KB
最終ジャッジ日時 2023-08-27 06:42:39
合計ジャッジ時間 4,229 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,216 KB
testcase_01 AC 72 ms
15,268 KB
testcase_02 AC 75 ms
15,304 KB
testcase_03 AC 80 ms
15,280 KB
testcase_04 AC 80 ms
15,384 KB
testcase_05 AC 101 ms
16,936 KB
testcase_06 AC 117 ms
16,532 KB
testcase_07 AC 93 ms
15,472 KB
testcase_08 AC 99 ms
15,996 KB
testcase_09 AC 118 ms
17,004 KB
testcase_10 AC 80 ms
15,340 KB
testcase_11 AC 83 ms
15,492 KB
testcase_12 AC 89 ms
15,660 KB
testcase_13 AC 108 ms
16,304 KB
testcase_14 AC 117 ms
17,044 KB
testcase_15 AC 84 ms
15,364 KB
testcase_16 AC 83 ms
15,476 KB
testcase_17 AC 81 ms
15,228 KB
testcase_18 AC 78 ms
15,200 KB
testcase_19 AC 126 ms
17,168 KB
testcase_20 AC 120 ms
17,076 KB
testcase_21 AC 86 ms
15,548 KB
testcase_22 AC 86 ms
15,448 KB
testcase_23 AC 89 ms
15,472 KB
testcase_24 AC 112 ms
16,280 KB
testcase_25 AC 122 ms
16,836 KB
testcase_26 AC 96 ms
15,772 KB
testcase_27 AC 93 ms
15,648 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
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をBITで管理できれば
	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