結果

問題 No.40 多項式の割り算
ユーザー hotpepsi
提出日時 2015-06-18 01:20:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 64,296 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-07 03:36:52
合計ジャッジ時間 1,651 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>

using namespace std;

int main(int argc, char *argv[]) {
	string s;
	getline(cin, s);
	stringstream sa(s);
	int D;
	sa >> D;
	getline(cin, s);
	stringstream sb(s);
	int b[10002] = {};
	for (int i = 0; i <= D; ++i) {
		sb >> b[i];
	}
	for (int i = D; i >= 3; --i) {
		b[i - 2] += b[i];
	}
	cout << b[0];
	if (b[1] || b[2]) {
		cout << " " << b[1];
		if (b[2]) {
			cout << " " << b[2];
		}
	}
	cout << endl;
	return 0;
}
0