結果
問題 | No.216 FAC |
ユーザー |
|
提出日時 | 2016-08-17 16:55:39 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 89 ms / 1,000 ms |
コード長 | 509 bytes |
コンパイル時間 | 68 ms |
コンパイル使用メモリ | 7,680 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-11-07 18:49:11 |
合計ジャッジ時間 | 3,352 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
Syntax OK
ソースコード
class Calc0216def initialize(args)args = args.map { |l| l.chomp.split(/\s+/) }@n = args.shift.first.to_i@as = args.shift.map(&:to_i)@bs = args.shift.map(&:to_i)enddef calcscores = Array.new(101) { 0 }max_score = 0@as.zip(@bs) do |a, b|if b == 0max_score += aelsescores[b] += aendendmax_score >= scores.maxenddef runcalc ? 'YES' : 'NO'endendputs Calc0216.new(STDIN.readlines).run if __FILE__ == $0