結果
| 問題 | No.40 多項式の割り算 | 
| コンテスト | |
| ユーザー |  ngtkana | 
| 提出日時 | 2020-03-27 01:53:16 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 4 ms / 5,000 ms | 
| コード長 | 540 bytes | 
| コンパイル時間 | 2,638 ms | 
| コンパイル使用メモリ | 193,988 KB | 
| 最終ジャッジ日時 | 2025-01-09 10:25:28 | 
| ジャッジサーバーID (参考情報) | judge3 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 32 | 
ソースコード
#include<bits/stdc++.h>
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint n;std::cin>>n;
    std::vector<lint>a(n+1);
    for(lint&x:a)std::cin>>x;
    for(lint i=n;i>=3;i--){
        a.at(i-2)+=a.at(i);
        a.at(i)=0;
    }
    while(1u<a.size()&&0==a.back())a.pop_back();
    n=a.size();
    std::cout<<n-1<<'\n';
    for(lint i=0;i<n;i++){
        std::cout<<(i?" ":"")<<a.at(i);
    }
    std::cout<<'\n';
}
            
            
            
        