728x90
9299번: Math Tutoring
For each case, output the line “Case x:” where x is the case number, on a single line. The output polynomial is to be formatted in the same manner as the input: the first value being the highest polynomial, and the successive values being the coefficie
www.acmicpc.net
문제 풀이
이 문제는 도함수를 구하는 문제이다. 한 줄씩 입력값이 주어질 때, 그 값들에 차수를 곱해주면 된다.
정답 코드
for i in range(1, int(input()) + 1) :
lst = [*map(int, input().split())]
print("Case {:d}: {:d}".format(i, lst[0] - 1), end = " ")
cnt = lst[0]
for j in lst[1 : -1] :
print(j * cnt, end = " ")
cnt -= 1
print()
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 9310 - Arithmetic and Geometric Sums [python] (0) | 2023.03.24 |
---|---|
[BOJ/백준] 9306 - Practice: Roll Call [python] (0) | 2023.03.24 |
[BOJ/백준] 9298 - Ant Entrapment [python] (0) | 2023.03.24 |
[BOJ/백준] 9297 - Reducing Improper Fractions [python] (0) | 2023.03.24 |
[BOJ/백준] 9295 - 주사위 [python] (0) | 2023.03.24 |