結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー yuruhiyayuruhiya
提出日時 2020-07-26 14:23:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 52 ms
コンパイル使用メモリ 11,572 KB
実行使用メモリ 18,968 KB
最終ジャッジ日時 2023-09-11 00:21:42
合計ジャッジ時間 4,814 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,304 KB
testcase_01 AC 83 ms
15,180 KB
testcase_02 AC 82 ms
15,296 KB
testcase_03 AC 95 ms
15,544 KB
testcase_04 AC 89 ms
15,436 KB
testcase_05 AC 116 ms
16,492 KB
testcase_06 AC 138 ms
17,652 KB
testcase_07 AC 104 ms
15,760 KB
testcase_08 AC 115 ms
16,296 KB
testcase_09 AC 135 ms
17,248 KB
testcase_10 AC 91 ms
15,420 KB
testcase_11 AC 94 ms
15,444 KB
testcase_12 AC 101 ms
16,044 KB
testcase_13 AC 127 ms
17,076 KB
testcase_14 AC 138 ms
17,008 KB
testcase_15 AC 95 ms
15,444 KB
testcase_16 AC 95 ms
15,672 KB
testcase_17 AC 92 ms
15,388 KB
testcase_18 AC 87 ms
15,360 KB
testcase_19 AC 157 ms
18,968 KB
testcase_20 AC 142 ms
17,560 KB
testcase_21 AC 102 ms
15,436 KB
testcase_22 AC 97 ms
15,404 KB
testcase_23 AC 105 ms
15,916 KB
testcase_24 AC 141 ms
17,248 KB
testcase_25 AC 155 ms
18,176 KB
testcase_26 AC 112 ms
16,256 KB
testcase_27 AC 109 ms
16,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
level = gets.split.map &:to_i
ac_count = [0] * n

user = Hash.new
gets.to_i.times do |i|
	name, problem = gets.split
	id = problem.ord - 'A'.ord
	ac_count[id] += 1
	score = (50 * level[id] + 50 * level[id] / (0.8 + 0.2 * ac_count[id])).floor
	user[name] = [[0] * n, 0] if !user.key?(name)
	user[name][0][id] = score
	user[name][1] = i
end

result = user.sort_by { |name, (score, time)| [-score.sum, time] }
puts result.map.with_index(1) { |(name, (score, time)), i|
		[i, name, score, score.sum].flatten.join(' ')
     }.join("\n")
0