結果
| 問題 | No.40 多項式の割り算 | 
| コンテスト | |
| ユーザー |  btk | 
| 提出日時 | 2015-05-18 09:45:00 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 5,000 ms | 
| コード長 | 375 bytes | 
| コンパイル時間 | 540 ms | 
| コンパイル使用メモリ | 59,480 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-06 05:21:01 | 
| 合計ジャッジ時間 | 1,488 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 32 | 
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<strings.h>
using namespace std;
#define LL long long
int b[10010];
int main(){
	int d;
	cin>>d;
	for(int i=0;i<=d;i++)cin>>b[i];
	for(int i=d;i>=3;i--){
		b[i-2]+=b[i];
		b[i]=0;
	}
	while(d>0&&b[d]==0)d--;
	cout<<d<<endl;
	cout<<b[0];
	for(int i=1;i<=d;i++)
		cout<<" "<<b[i];
	cout<<endl;
}
            
            
            
        