我看到大多数人只是循环添加数字和他们的正方形。我尝试了不同的方法。使用小数学,我知道,我意识到我有这是一个非常有效的解决方案:公式“N数字的平方和” public static long sumOfNSquares(int N){
// This is the standard mathematical formula I learnt in grade 10
return (
(使用dajngo 1.9和Python 2.7版) 所以我有几个子类的抽象类。它看起来像这样: class Node(models.Model):
[...]
class Meta:
abstract = True
class Individual(Node):
[...]
class Company(Node):
[...]