結果
| 問題 | No.40 多項式の割り算 | 
| コンテスト | |
| ユーザー |  misora192 | 
| 提出日時 | 2020-06-13 22:00:31 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 5,000 ms | 
| コード長 | 704 bytes | 
| コンパイル時間 | 1,807 ms | 
| コンパイル使用メモリ | 168,164 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-25 22:56:06 | 
| 合計ジャッジ時間 | 3,082 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 32 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)
using namespace std;
typedef long long ll;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll d;
	cin >> d;
	vector<ll> a(d+1);
	rep(i, d+1) cin >> a[i];
	for(int i = d - 2; i >= 1; i--){
		a[i] += a[i+2];
	}
	if(a[2] != 0){
		cout << 2 << endl;
		cout << a[0] << " " << a[1] << " " << a[2] << endl;
	}else if(a[1] != 0){
		cout << 1 << endl;
		cout << a[0] << " " << a[1] << endl;
 	}else{
		 cout << 0 << endl;
		 cout << a[0] << endl;
	 }
}
            
            
            
        