Python 2 RUNTIME_ERROR

Правка en4, от hackerbaba, 2020-04-02 10:38:04

The submission link I tried uploading the following code for a problem statement. And got a runtime error for a large input of 400000 numbers. Could someone please help me understand. I am a bit new and hence am making these kind of mistakes.


no = int(raw_input()) nos = map(int, raw_input().split()) minNo = 10**13 for i in nos: if i < minNo: minNo = i div= [] # print(minNo) for i in range(1, (minNo)/2+2): if minNo % i == 0: div.append(i) div.append(minNo) # print(div) div=set(div) arrToRemove = [] for j in range(len(nos)): for i in div: if nos[j] % i != 0: arrToRemove.append(i) for t in arrToRemove: div.remove(t) print(len(div))
Теги python2, runtime error

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский hackerbaba 2020-04-02 10:38:04 43
en3 Английский hackerbaba 2020-04-02 10:16:24 20
en2 Английский hackerbaba 2020-04-02 10:15:31 6
en1 Английский hackerbaba 2020-04-02 10:14:24 739 Initial revision (published)