Submission #30572482


Source Code Expand

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

A.reverse()
C.reverse()
ans = []

while len(C) >= len(A):
    quotient = C[0] // A[0]
    ans.append(quotient)
    for idx, a in enumerate(A):
        C[idx] -= a * quotient
    C.pop(0)

print(*reversed(ans))

Submission Info

Submission Time
Task D - Polynomial division
User Aruma256
Language Python (3.8.2)
Score 400
Code Size 332 Byte
Status AC
Exec Time 28 ms
Memory 9064 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 19 ms 8896 KiB
example_01.txt AC 18 ms 8832 KiB
hand_00.txt AC 21 ms 9012 KiB
hand_01.txt AC 19 ms 8936 KiB
hand_02.txt AC 22 ms 9008 KiB
hand_03.txt AC 18 ms 8896 KiB
hand_04.txt AC 19 ms 8880 KiB
hand_05.txt AC 16 ms 8820 KiB
random_00.txt AC 19 ms 9064 KiB
random_01.txt AC 19 ms 8896 KiB
random_02.txt AC 19 ms 8880 KiB
random_03.txt AC 19 ms 9020 KiB
random_04.txt AC 21 ms 8828 KiB
random_05.txt AC 28 ms 8824 KiB
random_06.txt AC 25 ms 8936 KiB
random_07.txt AC 24 ms 8940 KiB
random_08.txt AC 20 ms 8824 KiB
random_09.txt AC 20 ms 9012 KiB
random_10.txt AC 24 ms 8936 KiB
random_11.txt AC 21 ms 8832 KiB