Submission #30487551


Source Code Expand

from numpy import poly1d

# 入力
N, M = map(int, input().split())
A = list(map(int, input().split()))
C = list(map(int, input().split()))

# 多項式インスタンスの生成
polyA = poly1d(list(reversed(A)))
polyC = poly1d(list(reversed(C)))

# Bを求める
polyB = polyC / polyA
# Bの係数
coefB = list(map(int, polyB[0].c))

# 順番を逆にして出力
ans = list(reversed(coefB))
print(*ans)

Submission Info

Submission Time
Task D - Polynomial division
User math_hiyoko
Language Python (3.8.2)
Score 400
Code Size 423 Byte
Status AC
Exec Time 103 ms
Memory 26940 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 20
Set Name Test Cases
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt
Case Name Status Exec Time Memory
example_00.txt AC 99 ms 26864 KiB
example_01.txt AC 94 ms 26780 KiB
hand_00.txt AC 101 ms 26860 KiB
hand_01.txt AC 99 ms 26888 KiB
hand_02.txt AC 96 ms 26580 KiB
hand_03.txt AC 96 ms 26776 KiB
hand_04.txt AC 100 ms 26680 KiB
hand_05.txt AC 94 ms 26780 KiB
random_00.txt AC 99 ms 26872 KiB
random_01.txt AC 99 ms 26792 KiB
random_02.txt AC 99 ms 26912 KiB
random_03.txt AC 103 ms 26716 KiB
random_04.txt AC 98 ms 26676 KiB
random_05.txt AC 98 ms 26816 KiB
random_06.txt AC 100 ms 26812 KiB
random_07.txt AC 98 ms 26840 KiB
random_08.txt AC 99 ms 26892 KiB
random_09.txt AC 98 ms 26940 KiB
random_10.txt AC 98 ms 26676 KiB
random_11.txt AC 98 ms 26752 KiB