結果

問題 No.5 数字のブロック
ユーザー mergerintarou
提出日時 2017-11-04 01:04:05
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 105 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 24,704 KB
最終ジャッジ日時 2024-11-23 15:43:15
合計ジャッジ時間 45,927 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 25 TLE * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: `-' after local variable or literal is interpreted as binary operator
Main.rb:9: warning: even though it seems like unary operator
Main.rb:2: warning: assigned but unused variable - b
Syntax OK

ソースコード

diff #

a = gets.to_i
b = gets
c = gets.split.sort
n = 0
while a >0 do
  a -= c[n].to_i
  n += 1
end
puts n -1
  
0