結果
| 問題 |
No.40 多項式の割り算
|
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2017-01-31 17:08:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 346 bytes |
| コンパイル時間 | 877 ms |
| コンパイル使用メモリ | 64,128 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 22:46:58 |
| 合計ジャッジ時間 | 2,210 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 1 |
ソースコード
#include <iostream>
using namespace std;
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];
a[i] = 0;
}
int ans = d >= 1 && a[2] ? 2 : d >= 0 && a[1] ? 1 : 0;
cout << ans << endl;
for(int i = 0; i <= ans; i++) cout << a[i] << (i == ans ? '\n' : ' ');
}
ldsyb