Skip to main content
Code Review

Search Results

Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results for project euler 12
Search options not deleted
96 results
13 votes
5 answers
3k views

Optimizing Project Euler #12 (Python 3)

I just figured out Project Euler problem #12. … The link to the problem is here: Project Euler #12 run = True p = 2 numberInUse = 3 def checkDivisors(number): numberOfDivisors = 0 for x in range(1, int(number+1)): if number%x ==0: …
2 votes
2 answers
935 views

Python Code Review - Project Euler #12

I just figured out Project Euler problem #12. This the first one I've done in Python, so I'm putting my code out there to hopefully get some constructive criticism. …
tjr226's user avatar
  • 121
1 vote
3 answers
651 views

Project Euler #12 (Highly divisible triangular numbers) in Python 3.x

I'm a beginner to programming and just started python, I've been trying to work through Project Euler challenges. … I wrote a program to solve Project Euler #12, which asks for the smallest number of the form 1+ 2 + 3 + ... + n which has over 500 divisors. …
3 votes
1 answer
330 views

Project Euler #12 in Swift - Highly divisible triangular number

I just finished Project Euler #12 in Swift, and since there is not any version yet on Code Review, I would like to have some comments on what I did to try to improve it. …
4 votes
1 answer
796 views

Project Euler #12 very long runtime

Project Euler Problem 12 asks to find the value of the first triangular number to have over 500 divisors, where the \$n\$th triangular number is \$\sum_{i=1}^{n} i\$. …
2 votes
3 answers
149 views

Project Euler #12 in C (memory management)

To do this I'm working through project Euler problems, and for problem #12 I have the following code: Utils.h: #ifndef C_SCRATCHPAD_UTILS_H #define C_SCRATCHPAD_UTILS_H #define BOOL char #define TRUE … factors->size; results->triangle_value = total; results->factors = factors->values; free(numbers); free(factors); return results; } void run_euler_problem() { printf("Problem #12
6 votes
2 answers
6k views

Project Euler #12 - highly divisible triangular number

The following is a solution to Project Euler problem number 12: which is to find the first triangular number with more than 500 divisors. The code takes far too long to complete (over 10 minutes). …
3 votes
3 answers
629 views

Project Euler #12 in C++ - highly divisible triangular number

Project Euler Problem 12 asks (paraphrased): The nth triangular number Tn = 1 + 2 + ... + n. T7 = 28 has 6 divisors (1, 2, 4, 7, 14, 28). What is the first Tn to have over 500 divisors? … But overall, it doesn't work as fast as I want it to - or as fast as I expect a proper solution to a Project Euler problem to work. How can this code be improved? …
Chiffa's user avatar
  • 191
7 votes
5 answers
1k views

Project Euler #12 - first triangle number with more than 500 divisors

I tried to solve Project Euler 12 with a first very naive solution by myself. It took nearly 30 minutes to run until it found the solution. …
3 votes
1 answer
105 views

Project Euler #12 in Scala — Highly divisible triangular numbers

As an exercise, I've attempted Project Euler problem #12 in Scala. I hope that somebody familiar with Scala can point out anything I'm doing which is not idiomatic in "functional style" Scala. …
bsa's user avatar
bsa
  • 793
10 votes
4 answers
660 views

Optimizing Project Euler Solution #12

I submitted the following code as a solution to Project Euler's #12. It's extremely slow, running in mean 7.13 seconds over 100 trials (I think; just using other submitted solutions as a benchmark. …
2 votes
1 answer
167 views

Triangle-numbers with lots of divisors (Project-Euler Problem 12)

The following is my python solution of project euler 12. The sequence of triangle numbers is generated by adding the natural numbers. …
12 votes
3 answers
16k views

Project Euler Problem 12 in Python

I'm trying to do Project Euler Problem 12, which reads as: The sequence of triangle numbers is generated by adding the natural numbers. …
1 vote
1 answer
168 views

Project Euler problem 12 Python

I'm new to python and programming in general and I found Project Euler problems a good way to practice python. But my code is pretty slow. …
12 votes
3 answers
6k views

Project Euler Problem 12 - triangle number with 500 divisors

I've just done Problem 12 of Project Euler: What is the value of the first triangle number to have over five hundred divisors? …

1
2 3 4 5
...
7
15 30 50 per page

AltStyle によって変換されたページ (->オリジナル) /