AtCoder Beginner Contest 096

Submission #5444992

Source codeソースコード

N = int(input())
ans = [2]
N -= 1

def is_prime(n):
    i = 2
    prime = True
    while i * i <= n:
        if n % i == 0:
            prime = False
            break
        i += 1
    return prime

next_val = 3
for _ in range(N):
    while not is_prime(next_val):
        next_val += 5
    ans.append(next_val)
    next_val += 5

print(*ans)

Submission

Task問題 D - Five, Five Everywhere
User nameユーザ名 じけい
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 AC
Score得点 400
Source lengthソースコード長 367 Byte
File nameファイル名
Exec time実行時間 17 ms
Memory usageメモリ使用量 3060 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample_01.txt,sample_02.txt,sample_03.txt
All 400 / 400 in01.txt,in02.txt,sample_01.txt,sample_02.txt,sample_03.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
in01.txt AC 17 ms 2940 KB
in02.txt AC 17 ms 3060 KB
sample_01.txt AC 17 ms 2940 KB
sample_02.txt AC 17 ms 2940 KB
sample_03.txt AC 17 ms 3060 KB