소수문제 털어가기 9020 골드바흐 제외, 아마 대입 여러번 해서 옳은거 하면 될듯
This commit is contained in:
6
zeta_python/9020.py
Normal file
6
zeta_python/9020.py
Normal file
@@ -0,0 +1,6 @@
|
||||
N = int(input()
|
||||
P = []
|
||||
last = 2
|
||||
for _ in range(N):
|
||||
|
||||
# 골듭흐 파티션
|
||||
16
zeta_python/completed/1929.py
Normal file
16
zeta_python/completed/1929.py
Normal file
@@ -0,0 +1,16 @@
|
||||
M, N = map(int, input().split())
|
||||
P = []
|
||||
|
||||
for i in range(2, N+1):
|
||||
for p in P:
|
||||
if i % p == 0:
|
||||
break
|
||||
elif p ** 2 > i:
|
||||
if i >= M:
|
||||
print(i)
|
||||
P.append(i)
|
||||
break
|
||||
else:
|
||||
if i >= M:
|
||||
print(i)
|
||||
P.append(i)
|
||||
24
zeta_python/completed/2581.py
Normal file
24
zeta_python/completed/2581.py
Normal file
@@ -0,0 +1,24 @@
|
||||
M, N = int(input()), int(input())
|
||||
P = []
|
||||
MP = []
|
||||
|
||||
|
||||
for i in range(2, N+1):
|
||||
for p in P:
|
||||
if i % p == 0:
|
||||
break
|
||||
elif p ** 2 > i:
|
||||
if i >= M:
|
||||
MP.append(i)
|
||||
P.append(i)
|
||||
break
|
||||
else:
|
||||
if i >= M:
|
||||
MP.append(i)
|
||||
P.append(i)
|
||||
|
||||
if MP:
|
||||
print(sum(MP))
|
||||
print(MP[0])
|
||||
else:
|
||||
print(-1)
|
||||
28
zeta_python/completed/4948.py
Normal file
28
zeta_python/completed/4948.py
Normal file
@@ -0,0 +1,28 @@
|
||||
N = int(input())
|
||||
P = []
|
||||
last = 1
|
||||
while N != 0:
|
||||
if 2*N > last:
|
||||
if last == 1:
|
||||
last = 2
|
||||
for i in range(last, 2*N+1):
|
||||
for p in P:
|
||||
if i % p == 0:
|
||||
break
|
||||
elif p ** 2 > i:
|
||||
P.append(i)
|
||||
break
|
||||
else:
|
||||
P.append(i)
|
||||
c = 0
|
||||
for p in P:
|
||||
if N < p <= 2 * N:
|
||||
c += 1
|
||||
elif p > 2*N:
|
||||
break
|
||||
if last < 2*N:
|
||||
last = 2*N
|
||||
|
||||
print(c)
|
||||
|
||||
N = int(input())
|
||||
Reference in New Issue
Block a user