結果
問題 |
No.476 正しくない平均
|
ユーザー |
|
提出日時 | 2017-03-17 23:19:26 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 213 bytes |
コンパイル時間 | 37 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-04 13:44:40 |
合計ジャッジ時間 | 3,413 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 20 WA * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
def calc_avg(nums) nums.inject(&:+)/nums.count end def parse(str_nums) str_nums.split(' ').map(&:to_i) end answer = parse(gets).last.to_i problem = parse(gets) puts answer == calc_avg(problem) ? 'YES' : 'NO'