Submission #6109844


Source Code Expand

N=int(input())

sosuu=[2]
sosuu2=[2]
ans=[]

for i in range(3,55556):
    for j in sosuu2:
        if i%j==0:
            break
    else:
        sosuu.append(i)
        if i<=int(55556**0.5)+1:
            sosuu2.append(i)

cnt=0
for j in sosuu:
    if cnt<N-1 and j%5==1:
        print(j,end=" ")
        cnt+=1
    elif cnt==N-1 and j%5==1:
        print(j,end="")
        break

Submission Info

Submission Time
Task D - Five, Five Everywhere
User tmg_dayo
Language Python (3.4.3)
Score 400
Code Size 403 Byte
Status AC
Exec Time 69 ms
Memory 3188 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 5
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All in01.txt, in02.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
in01.txt AC 69 ms 3188 KB
in02.txt AC 69 ms 3188 KB
sample_01.txt AC 69 ms 3188 KB
sample_02.txt AC 67 ms 3188 KB
sample_03.txt AC 66 ms 3188 KB