結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー |
![]() |
提出日時 | 2016-11-28 23:25:36 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 1,980 ms / 2,000 ms |
コード長 | 1,487 bytes |
コンパイル時間 | 55 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 17,536 KB |
最終ジャッジ日時 | 2024-11-27 12:50:34 |
合計ジャッジ時間 | 16,454 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
problem_num = gets.to_istar_table = gets.split.map(&:to_i)problem_table = {}problem_num.times do |n|problem_table[(n+65).chr] = 1endscore = Hash.new { |a, b| a[b] = Hash.new { |c, d| c[d] = 0 } }score_total = Hash.new { |c, d| c[d] = 0 }submit_order = {}submit_num = gets.to_isubmit_num.times do |n|tmp = gets.splitscore[tmp[0]][tmp[1]] = (star_table[tmp[1].ord - 65] * 50 + 50 * star_table[tmp[1].ord - 65] / (0.8 + 0.2 * problem_table[tmp[1]])).floorscore_total[tmp[0]] = score_total[tmp[0]] + score[tmp[0]][tmp[1]]submit_order[tmp[0]] = nproblem_table[tmp[1]] += 1endscore_total_desc = score_total.sort { |(k1, v1), (k2, v2)| v2 <=> v1 }score_order = {}score_total_desc.each_with_index do |(k1, v1), n1|num = 1score_total_desc.each_with_index do |(k2, v2), n2|if n1+1 != submit_order.size thenif k1 == k2 thennextelsescore_order[k1] = numendendif v1 < v2 thennum += 1nextelsif v1 > v2 thenscore_order[k1] = numbreakelsif v1 == v2 thenif submit_order[k1] > submit_order[k2] thennum += 1endendendscore_order[k1] = numendscore_order_asc = score_order.sort { |(k1, v1), (k2, v2)| v1 <=> v2 }ans = []score_order_asc.each do |k, v|line = v.to_s + " " + k + " "problem_table.each_key do |t|line += score[k][t].to_s + " "endline += score_total[k].to_sans << lineendans.each do |a|puts aend