結果

問題 No.216 FAC
ユーザー 👑 horiesinitihoriesiniti
提出日時 2016-06-14 03:24:33
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 196 bytes
コンパイル時間 31 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-17 19:28:27
合計ジャッジ時間 3,000 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
12,160 KB
testcase_01 AC 87 ms
12,160 KB
testcase_02 AC 79 ms
12,160 KB
testcase_03 AC 80 ms
12,160 KB
testcase_04 AC 81 ms
12,032 KB
testcase_05 AC 81 ms
12,288 KB
testcase_06 AC 78 ms
12,288 KB
testcase_07 AC 83 ms
12,160 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 80 ms
12,160 KB
testcase_12 WA -
testcase_13 AC 77 ms
12,160 KB
testcase_14 WA -
testcase_15 AC 81 ms
12,160 KB
testcase_16 AC 78 ms
12,288 KB
testcase_17 AC 82 ms
12,288 KB
testcase_18 WA -
testcase_19 AC 81 ms
12,288 KB
testcase_20 WA -
testcase_21 AC 81 ms
12,288 KB
testcase_22 AC 80 ms
12,160 KB
testcase_23 AC 82 ms
12,160 KB
testcase_24 WA -
testcase_25 AC 82 ms
12,160 KB
testcase_26 AC 79 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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