結果

問題 No.40 多項式の割り算
ユーザー koba-e964
提出日時 2015-06-05 18:12:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 1,316 ms
コンパイル使用メモリ 158,212 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 14:17:24
合計ジャッジ時間 5,754 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 3 WA * 9 RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int a[110];
int main(){
int d;
cin >> d;
for(int i = 0; i <= d; ++i) {
cin >> a[i];
}
for (int i = d; i >= 3; --i) {
 a[i - 3] += a[i];
}
int q = 2;
while (q >= 1 && a[q] == 0) q--;
cout << q << endl;
for(int i=0;i<=q;i++) {
cout << a[i] << (i == q ? "\n" : " ");
}
}
0