結果

問題 No.216 FAC
ユーザー horiesiniti
提出日時 2016-06-14 03:24:33
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 196 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-10-09 13:32:12
合計ジャッジ時間 3,479 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

k=0
n=STDIN.gets.to_i
a=STDIN.gets.split(" ")
b=STDIN.gets.split(" ")

a.zip(b) do |e1,e2|
	if e2.to_i==0 then
		k+=e1.to_i
	else
		k-=e1.to_i
	end
end
if 0<=k then
	puts "YES"
else
	puts "NO"
end
0