Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecteuler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
projecteuler
Commits
bd0d4148
Commit
bd0d4148
authored
Dec 07, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solved 53
parent
76268ce5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
problem53.py
problem53.py
+22
-0
No files found.
problem53.py
0 → 100755
View file @
bd0d4148
#!/usr/bin/python
from
math
import
ceil
prev
=
[
1
,
2
]
s
=
0
for
n
in
range
(
2
,
100
):
cur
=
[
1
]
half
=
int
(
ceil
(
n
/
2.
))
for
r
in
range
(
1
,
half
+
1
):
cur
.
append
(
prev
[
r
-
1
]
+
prev
[
r
])
if
cur
[
-
1
]
>
1000000
:
s
+=
2
if
not
n
&
1
or
r
!=
half
else
1
if
not
n
&
1
:
cur
.
append
(
cur
[
-
1
])
prev
=
cur
print
s
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment