강의로 돌아가기
김형규

허용되지 않는 시스템 호출 뜨는 이유?

import numpy as np
def solution(bridgelength, weight, truckweights):
time =0
bridge=list(np.zeros(bridgelength,dtype=int))
merge
bridge = bridge+truckweights
while sum(merge
bridge) != 0:
if sum(mergebridge[:bridgelength+1]) < weight:
del mergebridge[0]
merge
bridge.append(0)
else:
del mergebridge[0]
merge
bridge.insert(bridge_length-1,0)

    time += 1

return time
작성중인 코드―solution.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import numpy as np
def solution(bridge_length, weight, truck_weights):
    time =0
    bridge=list(np.zeros(bridge_length,dtype=int))
    merge_bridge = bridge+truck_weights
    while sum(merge_bridge) != 0:
        if sum(merge_bridge[:bridge_length+1]) < weight:
           del merge_bridge[0]
           merge_bridge.append(0)
        else:
           del merge_bridge[0]
           merge_bridge.insert(bridge_length-1,0)

        time += 1

    return time
1 개의 답변
박범수

https://www.welcomekakao.com/learn/questions/3577

numpy 가 표준 라이브러리가 아니어서 그렇습니다.

답변 쓰기
이 입력폼은 마크다운 문법을 지원합니다. 마크다운 가이드 를 참고하세요.