Số nguyên tố

lqdoj
 avatar
tocdovodoi
plain_text
2 months ago
463 B
4
Indexable
Never
n = int(input())
ds = list(map(int,input().split()))

def check(n):
    if n<2:
        return 0
    dem=0
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            dem+=1
            return 0
    return 1

dsMax=[]
indexMax=[]
for i in range(len(ds)):
    if check(ds[i])==1:
        dsMax.append(ds[i])
        indexMax.append(i)
max = max(dsMax)
print(max)
for i in range(len(ds)):
    if max==ds[i]:
        print(i+1,end=" ")
Leave a Comment