-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEuler005.py
39 lines (32 loc) · 1.33 KB
/
Euler005.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ==============================================================================
# title : Euler005.py
# description : https://projecteuler.net/problem=5
# author : Marcel
# date : 2022-07-17
# version : 1.0
# python_version : 3.10.5
# ==============================================================================
from time import *
def solve():
n = 1
while True:
if (n % 19 == 0):
if (n % 17 == 0):
if (n % 13 == 0):
if (n % 11 == 0):
if (n % 7 == 0):
if (n % 5 == 0):
if (n % 3 == 0):
if ( n % 2 == 0 and n % 4 == 0
and n % 6 == 0 and n % 8 == 0
and n % 9 == 0 and n % 10 == 0
and n % 12 == 0 and n % 14 == 0
and n % 15 == 0 and n % 16 == 0
and n % 18 == 0 and n % 20 == 0):
print(n)
break
n += 1
t1 = time()
solve()
t2 = time()
print('Running for: ', round(t2 - t1, 4), 'sec')