結果
問題 |
No.40 多項式の割り算
|
ユーザー |
![]() |
提出日時 | 2014-11-24 02:22:32 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 352 bytes |
コンパイル時間 | 319 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2025-01-02 21:06:39 |
合計ジャッジ時間 | 2,519 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 32 |
ソースコード
import itertools as it d = int(input()) a_list = list(map(int, input().split())) a_list.reverse() for i in range(len(a_list) - 3): a_list[i+2] += a_list[i] result = list(it.dropwhile(lambda x: x == 0, a_list[-3:])) result.reverse() print(len(result) - 1) if len(result) == 0: result = [0,] print(" ".join(map(str, result)))