結果
| 問題 | No.40 多項式の割り算 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-09-16 14:47:19 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 37 ms / 5,000 ms | 
| コード長 | 363 bytes | 
| コンパイル時間 | 140 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 11,520 KB | 
| 最終ジャッジ日時 | 2024-11-08 01:32:01 | 
| 合計ジャッジ時間 | 2,223 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 32 | 
ソースコード
# -*- coding: utf-8 -*-
D = int(input())
a = list(map(int, input().split()))
for i in range(D, 2, -1):
    q = a[i]
    e = i - 3
    a[e+1] += q
d = min(2, D)
for i in range(d, -1, -1):
    d = i
    if a[i] != 0:
        break
print(d)
for i in range(d+1):
    if i==0:
        print(str(a[i]), end='')
    else:
        print(' '+str(a[i]), end='')
print()
            
            
            
        