Submission #6015758


Source Code Expand

def main():
	N = int(input())
	ps = [2]
	ans = ["2"]
	i = 3
	while len(ans) < N:
		is_prime = True
		for p in ps:
			if i % p == 0:
				is_prime = False
				break

		if is_prime:
			ps.append(i)
			if i % 5 == 2:
				ans.append(str(i))
		i += 1
	print(" ".join(ans))


if __name__ == '__main__':
    main()

Submission Info

Submission Time
Task D - Five, Five Everywhere
User nsasaki128
Language Python (3.4.3)
Score 400
Code Size 327 Byte
Status AC
Exec Time 19 ms
Memory 3064 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 17 ms 3060 KB
in02.txt AC 19 ms 3060 KB
sample_01.txt AC 17 ms 3064 KB
sample_02.txt AC 17 ms 3060 KB
sample_03.txt AC 17 ms 3064 KB