結果

問題 No.40 多項式の割り算
ユーザー naimonon77naimonon77
提出日時 2016-02-29 06:54:36
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 915 bytes
コンパイル時間 2,347 ms
コンパイル使用メモリ 160,176 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 19:07:48
合計ジャッジ時間 3,878 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#ifdef __unix__
#include <bits/stdc++.h>
#else
#include "bits\stdc++.h"
#endif
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <list>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
#define VI vector<int>
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define SQR(X) ((X)*(X))

#define MAX 10005

int main() {
  int i,j,k,l;
  int D;
  ll a[MAX];
  cin >> D;
  rep(i,D+1) cin >> a[i];
  rep(i,(D+1)/2) swap(a[i],a[D-i]);
  // rep(i,D+1) cout << a[i] << " ";
  // cin >> D;
  rep(i,D-2) {
    a[i+2] += a[i];
  }
  
  for(j=0;j<2;j++) {
    if(a[i+j] != 0) break;
  }
  cout << 2-j << endl;
  for(k=0;k<2-j;k++) {
    cout << a[D-k] << " ";
  }
  cout << a[D-k] << endl;
  /*i += j;
  for(;i<D;i++) {
    cout << a[i] << " ";
  }
  cout << a[i] << endl;*/
  return 0;
}
0