結果

問題 No.40 多項式の割り算
ユーザー atn112323atn112323
提出日時 2016-05-08 13:20:47
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 399 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 54,260 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 13:48:12
合計ジャッジ時間 1,887 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 4 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 3 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 4 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 3 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 1 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int D;
int a[10001];

int main() {
	cin >> D;
	for (int i = 0; i <= D; i++) {
		cin >> a[i];
	}
	for (int i = D; i >= 3; i--) {
		a[i - 2] += a[i];
	}
	int DD = 0;
	for (int i = 2; i > 0; i--) {
		if (a[i] > 0) {
			DD = i;
			break;
		}
	}
	cout << DD << endl;
	for (int i = 0; i < DD; i++) {
		cout << a[i] << " ";
	}
	cout << a[DD] << endl;
	return 0;
}
0