Initial release
This commit is contained in:
23
Le problème des boîtes à sucres.py
Normal file
23
Le problème des boîtes à sucres.py
Normal file
@@ -0,0 +1,23 @@
|
||||
mini = 109
|
||||
maxi = 491
|
||||
|
||||
def only_one(n):
|
||||
sol = list()
|
||||
for i in range(2, n//4+1):
|
||||
for j in range(2, n//i+1):
|
||||
for k in range(2, n//i//j+1):
|
||||
if i*j*k == n:
|
||||
if len(sol)>1:
|
||||
return False
|
||||
else:
|
||||
if sorted((i,j,k)) not in sol:
|
||||
sol.append(sorted((i,j,k)))
|
||||
|
||||
return len(sol)==1
|
||||
|
||||
solution = list()
|
||||
for i in range(mini, maxi+1):
|
||||
if only_one(i):
|
||||
solution.append(i)
|
||||
|
||||
print(solution)
|
||||
Reference in New Issue
Block a user