結果

問題 No.216 FAC
ユーザー finefine
提出日時 2015-10-11 19:08:44
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 247 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 11,252 KB
実行使用メモリ 15,280 KB
最終ジャッジ日時 2023-09-28 11:49:14
合計ジャッジ時間 3,795 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,176 KB
testcase_01 AC 87 ms
15,252 KB
testcase_02 AC 84 ms
15,040 KB
testcase_03 AC 84 ms
15,280 KB
testcase_04 AC 83 ms
15,172 KB
testcase_05 AC 85 ms
15,252 KB
testcase_06 AC 83 ms
15,228 KB
testcase_07 AC 83 ms
15,084 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 84 ms
15,036 KB
testcase_12 WA -
testcase_13 AC 85 ms
15,088 KB
testcase_14 WA -
testcase_15 AC 84 ms
15,252 KB
testcase_16 AC 83 ms
15,248 KB
testcase_17 AC 82 ms
15,164 KB
testcase_18 WA -
testcase_19 AC 84 ms
15,096 KB
testcase_20 WA -
testcase_21 AC 83 ms
15,256 KB
testcase_22 AC 83 ms
15,072 KB
testcase_23 AC 84 ms
15,028 KB
testcase_24 WA -
testcase_25 AC 85 ms
15,032 KB
testcase_26 AC 84 ms
15,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n = gets.to_i
a = gets.chomp.split(" ").map(&:to_i)
b = gets.chomp.split(" ").map(&:to_i)
score = 0
sum = 0
a.each{|x|
 sum += x
}
b.each_index{|i|
 if b[i] == 0
  score += a[i]
 end
}
if sum - score <= score
 puts "YES"
else
 puts "NO"
end
  
  
0