結果

問題 No.40 多項式の割り算
ユーザー aaaaaaiu
提出日時 2019-08-03 00:48:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 431 bytes
コンパイル時間 1,712 ms
コンパイル使用メモリ 192,900 KB
最終ジャッジ日時 2025-01-07 10:35:57
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int d;
    cin >> d;
    int a[d+1];
    for (int i=0;i<=d;i++) cin>>a[i];
    for (int i=d;i>=3;i--) a[i-2] += a[i];
    if (d >= 2 && a[2]) cout << 2 << endl << a[0] << ' ' << a[1] << ' ' << a[2] << endl;
    else if (d >= 1 && a[1]) cout << 1 << endl << a[0] << ' ' << a[1] << endl;
    else cout << 0 << endl << a[0] << endl;
    return 0;
}
0