結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2018-07-29 18:29:13 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 83 ms / 1,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 34 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-18 09:32:12 |
合計ジャッジ時間 | 3,004 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
Syntax OK
ソースコード
#!/bin/rubyn = gets.chomp.to_ia = gets.chomp.split(' ')b = gets.chomp.split(' ')scores = { k: 0 }n.times do | num |if b[num] === '0'scores[:k] += a[num].to_ielseif scores.key?(b[num])scores[b[num]] += a[num].to_ielsescores.store(b[num], a[num].to_i)endendendif scores.values.max === scores[:k]puts 'YES'elseputs 'NO'end