結果

問題 No.476 正しくない平均
ユーザー owlworksowlworks
提出日時 2017-03-17 23:19:26
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 213 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 11,392 KB
実行使用メモリ 15,328 KB
最終ジャッジ日時 2023-09-17 19:25:40
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,092 KB
testcase_01 WA -
testcase_02 AC 81 ms
15,168 KB
testcase_03 AC 81 ms
15,144 KB
testcase_04 AC 81 ms
15,272 KB
testcase_05 WA -
testcase_06 AC 81 ms
15,296 KB
testcase_07 AC 82 ms
15,124 KB
testcase_08 AC 80 ms
15,080 KB
testcase_09 AC 80 ms
15,128 KB
testcase_10 AC 82 ms
15,140 KB
testcase_11 WA -
testcase_12 AC 81 ms
15,036 KB
testcase_13 AC 82 ms
15,096 KB
testcase_14 AC 81 ms
15,304 KB
testcase_15 AC 80 ms
15,328 KB
testcase_16 AC 82 ms
15,268 KB
testcase_17 AC 80 ms
15,116 KB
testcase_18 AC 81 ms
15,088 KB
testcase_19 AC 82 ms
15,264 KB
testcase_20 WA -
testcase_21 AC 81 ms
15,016 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 81 ms
15,252 KB
testcase_25 AC 81 ms
15,312 KB
testcase_26 WA -
testcase_27 AC 82 ms
15,316 KB
testcase_28 AC 81 ms
15,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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'
0