10539 수빈이와 수열1 10539-수빈이와 수열 (python, 파이썬) n = int(input()) array = list(map(int, input().split())) result = [] for x in range(n): result.append((x+1)*array[x]-sum(result[:x])) print(' '.join([str(n) for n in result])) - 데이터가 많아지면 append를 사용하지 않고, 리스트를 미리 만들어 인덱스별로 할당하는 게 낫다 2020. 10. 14. 이전 1 다음