結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
mesh1nek0x0
|
| 提出日時 | 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/ruby
n = gets.chomp.to_i
a = gets.chomp.split(' ')
b = gets.chomp.split(' ')
scores = { k: 0 }
n.times do | num |
if b[num] === '0'
scores[:k] += a[num].to_i
else
if scores.key?(b[num])
scores[b[num]] += a[num].to_i
else
scores.store(b[num], a[num].to_i)
end
end
end
if scores.values.max === scores[:k]
puts 'YES'
else
puts 'NO'
end
mesh1nek0x0