triangle numbers in python

前端 未结 6 1338
别那么骄傲
别那么骄傲 2020-12-08 17:38

I\'m trying to solve the problem:

What is the value of the first triangle number to have over five hundred divisors?

A trian

6条回答
  •  醉酒成梦
    2020-12-08 18:04

    Your current brute force algorithm is too inefficient to solve this problem in the Project Euler time limit of 1 minute. Instead, I suggest looking at the Divisor Function:

    http://www.artofproblemsolving.com/Wiki/index.php/Divisor_function

提交回复
热议问题