結果
| 問題 |
No.40 多項式の割り算
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-13 10:14:23 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 415 bytes |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,672 KB |
| 最終ジャッジ日時 | 2024-12-29 17:35:30 |
| 合計ジャッジ時間 | 4,754 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 3 WA * 29 |
コンパイルメッセージ
Syntax OK
ソースコード
class Solve
def initialize
_ = gets.to_i
@a_list = gets.chomp.split.map(&:to_i)
end
def run
len = @a_list.size
(len - 1).downto(3) do |i|
if @a_list[i] != 0
@a_list[i-2] += @a_list[i]
@a_list[i] = 0
end
end
3.downto(0) do |i|
if @a_list[i]
puts i
puts @a_list[0..i].join(' ')
break
end
end
end
end
Solve.new.run