Skip to content

Instantly share code, notes, and snippets.

@dproject21
Created January 20, 2013 08:35
Show Gist options
  • Save dproject21/4577301 to your computer and use it in GitHub Desktop.
Save dproject21/4577301 to your computer and use it in GitHub Desktop.
プロジェクトオイラー problem9の解答
a = 1
while(! (500000 % (1000 - a) == 0)) {
a += 1
}
b = 1000 * (a - 500) / (a - 1000)
c = Math.sqrt(a ** 2 + b ** 2).toInteger()
ans = a * b * c
println(ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment