結果

問題 No.216 FAC
ユーザー Takuya Noguchi
提出日時 2018-02-24 22:21:33
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 43 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-11-06 09:11:17
合計ジャッジ時間 3,370 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets

def get_nums
  gets.split.map(&:to_i)
end

def k_highest_scorer?
  get_nums.zip(get_nums).each_with_object(Hash.new(0)) { |(point, num), hash|
    hash[num] += point
  }.sort_by { |_, point| -point }.first[0] == 0
end

puts k_highest_scorer? ? 'YES' : 'NO'
0