結果
問題 |
No.40 多項式の割り算
|
ユーザー |
![]() |
提出日時 | 2017-01-31 17:03:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 321 bytes |
コンパイル時間 | 545 ms |
コンパイル使用メモリ | 64,228 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-12-23 22:43:55 |
合計ジャッジ時間 | 1,761 ms |
ジャッジサーバーID (参考情報) |
judge2 / 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 = a[2] ? 2 : a[1] ? 1 : 0; cout << ans << endl; for(int i = 0; i <= ans; i++) cout << a[i] << ' '; cout << endl; }