結果

問題 No.40 多項式の割り算
ユーザー irisAshirisAsh
提出日時 2017-08-20 16:37:36
言語 JavaScript
(node v20.8.0)
結果
WA  
実行時間 -
コード長 411 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 7,028 KB
実行使用メモリ 44,712 KB
最終ジャッジ日時 2023-08-03 02:18:55
合計ジャッジ時間 4,376 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

let x = [1, 0, -1, 0]
let i = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
let d = parseInt(i[0])
let a = i[1].split(' ').map((e) => parseInt(e))
for (let n = 5; n >= 3; n--) {
  let b = a[n]
  for (let m = 0; m <= 3; m++) {
    a[n - m] -= b * x[m]
  }
}
let o = 0
for (let n = 2; n >= 0 ; n--) {
  if (a[n] != 0) {
    o = n
    break
  }
}
console.log(o)
console.log(a.slice(0,o+1).join(' '))
0