ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1086. Cryptography

Runtime error in python
Posted by Yeahia Md Abid 4 Jan 2018 23:16

import math
def getList(maxNumber):
    primeLst = []
    for num in range(2,15000):
        if all(num%i!=0 for i in range(2,int(math.sqrt(num))+1)):
           primeLst.append(num)
           if len(primeLst)==maxNumber:
                return primeLst

lst = []
for x in range(int(input())):
    lst.append(int(input()))
primeNumbers = getList(max(lst))
for x in lst:
    print(primeNumbers[x-1])

I don't know why my code is error in testcase 2
Can anybody help me out of here ?