Problem:


Score : 300 points

Problem Statement

Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:

1 \leq x,y,z

x^2 + y^2 + z^2 + xy + yz + zx = n

Given an integer N, find each of f(1),f(2),f(3),\ldots,f(N).

Constraints

All values in input are integers.

1 \leq N \leq 10^4

Input

Input is given from Standard Input in the following format:

N

Output

Print N lines. The i-th line should contain the value f(i).

Sample Input 1

20

Sample Output 1

0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0

For n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.

For n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.

For n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.

For n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.



Sample input:
20


Sample output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    for n in range(1, N+1):
        cur = 0
        for x in range(1, N+1):
            if n < x**2:
                break
            for y in range(1, N+1):
                if n < x**2 + y**2 + x*y:
                    break
                for z in range(1, N+1):
                    if n < x**2 + y**2 + z**2 + x*y + y*z + z*x:
                        break
                    if n == x**2 + y**2 + z**2 + x*y + y*z + z*x:
                        cur += 1
        print(cur)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

for i in range(1,N+1):
    ans = 0
    L = int(i**0.5)
    for x in range(1,L+1):
        for y in range(1,L+1):
            for z in range(1,L+1):
                num = x*x+y*y+z*z+x*y+y*z+z*x
                if num == i:
                    ans += 1
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

for i in range(1, n + 1):
    ans = 0
    for x in range(1, n + 1):
        if x**2 + x >= i:
            continue
        for y in range(1, n + 1):
            if x**2 + y**2 + x * y >= i:
                continue
            for z in range(1, n + 1):
                if z**2 >= i:
                    continue

                if x**2 + y**2 + z**2 + x * y + y * z + z * x == i:
                    ans += 1

    print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
for i in range(1, n + 1):
    count = 0
    num = int(n ** 0.5)
    for j in range(1, num + 1):
        for k in range(1, num + 1):
            for l in range(1, num + 1):
                if j ** 2 + k ** 2 + l ** 2 + j * k + k * l + l * j == i:
                    count += 1
    print(count)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

def main():
    from builtins import int, map
    N = int(input())

    def count(k):
        ans = 0
        NN = int(k ** 0.5) + 1
        for x in range(1, NN):
            for y in range(1, min(NN, k - x * x)):
                for z in range(1, min(NN, k - x * x - y * y)):
                    if x * x + y * y + z * z + x * y + y * z + z * x == k:
                        ans += 1
        return ans

    for k in range(1, N + 1):
        print(count(k))

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
from collections import defaultdict as dd
N = int(input())
dic=dd(int)
for x in range(1,N+1):
    t1 = N-x**2
    if t1 <= 1:
        continue
    for y in range(1,t1+1):
        t2 = N-x**2-y**2
        if t2 <= 0:
            continue
        for z in range(1,t2+1):
            dic[x**2+y**2+z**2+x*y+y*z+z*x] += 1
for i in range(N):
    print(dic[i+1])

Submission status: Memory Limit Exceeded

Solution code:
from itertools import product

N = int(input())

cnt = [0]*300000000

for x in range(1,N):
    flag=0
    for y in range(1,N):
        if flag==1:
            break
        elif x*y>=10**4:
            break
        for z in range(1,N):
            if x*z>=10**4 or y*z>=10**4:
                flag=1
                break
            else:
                cnt[x**2 + y**2 + z**2 + x*y + y*z + z*x -1] += 1



for i in range(N):
    print(cnt[i])

Submission status: Memory Limit Exceeded

Solution code:
from math import sqrt
l = [-1]+[0]*10**8
n = int(input())
for i in range(1,int(sqrt(n))+1):
    for j in range(1,int(sqrt(n))+1):
        for k in range(1,int(sqrt(n))+1):
            l[i**2+j**2+k**2+i*j+j*k+k*i] += 1
for i in range(1,n+1):
    print(l[i])

Submission status: Accepted

Solution code:
from math import sqrt, floor

N = int(input())
d = [0] * (N+1)

k = floor(sqrt(N))
for x in range(1, k):
    for y in range(1, k):
        for z in range(1, k):
            c = x*x + y*y + z*z + x*y + y*z + z*x
            if 1 <= c <= N:
                d[c] += 1


for i in range(1, N+1):
    print(d[i])

Submission status: Accepted

Solution code:
n=int(input())
A=[0]*(n+1)
for x in range(1,101):
    for y in range(1,101):
        if x**2+y**2+x*y>n :break
        for z in range(1,101):
            qq= x**2+y**2+z**2+x*y+y*z+z*x 
            if qq>n:break
            A[qq]+=1
print(*A[1:],sep="\n")

Submission status: Accepted

Solution code:
N=int(input())

f=[0]*(N+1)

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            temp=x**2+y**2+z**2+x*y+y*z+z*x
            if temp<=N:
                f[temp]+=1

for i in range(1,N+1):
    print(f[i])

Submission status: Accepted

Solution code:
from math import sqrt, floor

N = int(input())
d = [0] * (N+1)

k = floor(sqrt(N))
for x in range(1, k):
    for y in range(1, k):
        for z in range(1, k):
            c = x*x + y*y + z*z + x*y + y*z + z*x
            if 1 <= c <= N:
                d[c] += 1


for i in range(1, N+1):
    print(d[i])

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from math import sqrt
from collections import defaultdict
def main():
    n = int(input())
    n2 = int(sqrt(n) + 1)
    d1 = defaultdict(int)

    for i1 in range(1, n2):
        for i2 in range(1, n2):
            for i3 in range(1, n2):
                #p = (i1 + i2) ** 2 - (i1 * i2) + i3 * (i1 + i2 + i3)
                p = i1 ** 2 + i2 ** 2 + i3 ** 2 + i1 * i2 + i2 * i3 + i1 * i3
                d1[p] += 1

    for j1 in range(1, n + 1):
        print(d1[j1])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = [0] * (N+1)
search = int(math.sqrt(N))+1

for x in range(1 , search):
  for y in range(1 , search):
    for z in range(1 , search):
      con = x*(x + y + z) + y*y + z*z + y*z
      if con <= N:
        ans[con] += 1
      else:
        break

for a in range(1,N+1):
  print(ans[a])

Submission status: Accepted

Solution code:
n= int(input())
ans= [0]*10001

for x in range(1,101):
    for y in range (1,101):
        for z in range(1,101):
            mul= x*x+y*y+z*z+x*y+y*z+z*x
            if  mul <= 10000:
                ans[mul]+=1

for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import math
N = int(input())

def f(x,y,z):
    return x*x + y*y + z*z + x*y + y*z + z*x

ans = [0]*(N+1)

# upper = math.ceil(math.sqrt(N/6)) + 1
upper = int(math.sqrt(N)) + 1

for x in range(1, upper+1):
    for y in range(1, upper + 1):
        for z in range(1, upper + 1):
            v = f(x,y,z)
            if v <= N:
                ans[v] += 1
            else:
                break

for i in range(1, N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n=int(input())
ans = [0] * 100000
for x in range(1,101):
    for y in range(1,101):
        for z  in range(1,101):
            ans[x*x+y*y+z*z+x*y+y*z+z*x]+=1
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import math

n = int(input())
res = [0] * 100000
count = 0
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            ans = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if ans > 10001:
                break
            if ans <= 10000:
                res[ans] += 1

for i in range(n):
    print(res[i + 1])

Submission status: Accepted

Solution code:
c=[0 for i in range(10000)]

for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      n=x*x+y*y+z*z+z*y+y*x+x*z
      if n<=10000:
        c[n-1]+=1
print("\n".join(list(map(str,c))[:int(input())]))

Submission status: Accepted

Solution code:
def main():
    n = int(input())

    count_list = [0] * n
    upper = int(n**0.5) + 2
    for x in range(1, upper):
        for y in range(1, upper):
            for z in range(1, upper):
                num = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if num <= n:
                    count_list[num-1] += 1
    for count in count_list:
        print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

a = [0]*10001

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1,101):
        v = x*x+y*y+z*z+x*y+y*z+x*z
        if  v < 10001:
        	a[v] += 1
for i in range(n):
  print(a[i+1])

Submission status: Accepted

Solution code:
n = int(input())

ans = [0] * (n+1)
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            tmp = i*i + j*j + k*k + i*j + j*k + i*k
            if tmp <= n:
                ans[tmp] += 1

for i in range(1, n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    d = dict()
    for i in range(1, 10001):
        d[i] = 0
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                r = x**2+y**2+z**2+x*y+y*z+z*x
                if r <= 10000:
                    d[r] += 1
    for i in range(1, n+1):
        print(d[i])


main()

Submission status: Accepted

Solution code:
N = int(input())
Ans = [0] * (N + 1)


def calc(a, b, c):
    return a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a


for i in range(1, N):
    for j in range(1, N):
        for k in range(1, N):
            x = calc(i, j, k)
            if x > N:
                break
            Ans[x] += 1

for a in Ans[1:]:
    print(a)

Submission status: Accepted

Solution code:
# @uthor : Kaleab Asfaw
from sys import stdin, stdout
# Fast IO
def input():
	a = stdin.readline()
	if a[-1] == "\n": a = a[:-1]
	return a
def print(*argv, end="\n", sep=" "):
	n = len(argv)
	for i in range(n):
		if i == n-1: stdout.write(str(argv[i]))
		else: stdout.write(str(argv[i]) + sep)
	stdout.write(end)
# Others
mod = 10**9+7
def lcm(x, y): return (x * y) / (gcd(x, y))
def comb(lst, x):
	from itertools import combination as c
	return list(comb(lst, x))
def fact(x, mod=mod):
	ans = 1
	for i in range(1, x+1): ans = (ans * i) % mod
	return ans
def arr2D(n, m, default=0):
	lst = []
	for i in range(n): temp = [default] * m; lst.append(temp)
	return lst
def sortDictV(x): return {k: v for k, v in sorted(x.items(), key = lambda item : item[1])}
def smaller(lst, x): return bisect_left(lst, x) -1
def smallerEq(lst, x): return bisect_right(lst, x) -1

def solve(n):
	lst = [0] * 10000
	for i in range(1, 101):
		for j in range(1, 101):
			for k in range(1, 101):
				val = (i**2) + (j**2) + (k**2) + (i*j) + (i*k) + (j*k)
				if val >= 1 and val <= 10000:
					lst[val-1] += 1
	for i in range(0, n):
		print(lst[i])

n = int(input())
solve(n)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def f(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
def main():
    n = int(input())
    A = [0]*(n+1)
    for x in range(1,100):
        for y in range(x, 100):
            for z in range(y, 100):
                num = f(x,y,z)
                if num > n:
                    break
                if x == y and y == z:
                    A[num] += 1
                elif x == y or y == z or z == x:
                    A[num] += 3
                else:
                    A[num] += 6
    for i in range(1,n+1):
        print(A[i])

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
ans=[0 for i in range(10**5)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            tmp=x*x+y*y+z*z+x*y+y*z+z*x
            ans[tmp]+=1
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n=int(input())
a=[0]*10001
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      v=i**2+j**2+k**2+i*j+j*k+k*i
      if v<10001:
        a[v]+=1
for m in range(n):
  print(a[m+1])

Submission status: Accepted

Solution code:
N=int(input())
ans=[0]*(N+1)
rN=int(N**(1/2))
for x in range(1,rN+1):
    for y in range(1,rN+1):
        for z in range(1,rN+1):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n<=N:
                ans[n]+=1
                
for i in range(1,N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
N = int(input())
x = y = z = 1
ans = [0]*N
while True:
    if x**2 + y**2 + z**2 + x*y + y*z + z*x > N:
        break
    while True:
        if x**2 + y**2 + z**2 + x*y + y*z + z*x > N:
            break
        while True:
            a = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if a <= N:
                if x != y and y != z and z != x:
                    ans[a-1] += 6
                elif x == y and y == z:
                    ans[a-1] += 1
                else:
                    ans[a-1] += 3
                z += 1
            else:
                break
        y += 1
        z = y
    x += 1
    z = y = x
for n in ans:
    print(n)

Submission status: Accepted

Solution code:
from sys import stdin
inp = lambda : stdin.readline().strip()

n = int(inp())
a = [0]*10**5
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            a[i**2 + j**2 + k**2 + i*j + i*k + k*j] += 1
for i in a[1:n+1]:
    print(i)

Submission status: Accepted

Solution code:
N = int(input())
L = [0] * N
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      n = int(((x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2)/ 2 )
      if n <= N:
        L[n - 1] += 1
print(*L, sep='\n')

Submission status: Accepted

Solution code:
# ans

N = int(input())

ans = [0] * (N + 1)
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      n = x * x + y * y + z * z + x * y + y * z + z * x
      if n <= N:
        ans[n] += 1

for i in range(1, len(ans)):
  print(ans[i])

Submission status: Accepted

Solution code:
n = int(input())
li = [0]*n
p = int(n**0.5)
for x in range(1,p+1):
    for y in range(1,p+1):
        for z in range(1,p+1):
            k = x**2+y**2+z**2+x*y+y*z+z*x
            if k<=n:
                li[k-1]+=1

print(*li,sep="\n")

Submission status: Accepted

Solution code:
n=int(input())
a=[0 for i in range(100001)]
for i in range(1,41):
    a[6*(i**2)]+=1
for i in range(1,99):
    for j in range(1,i):
        if 3*(i**2)+j**2+2*i*j<=10000:
            a[3*(i**2)+j**2+2*i*j]+=3
        if 3*(j**2)+i**2+2*i*j <=10000:
            a[3*(j**2)+i**2+2*i*j]+=3
for i in range(1,100):
    for j in range(1,i):
        if i**2+j**2+i*j+i+j>9999:
            break
        for k in range(1,j):
            if i**2+j**2+k**2+i*j+i*k+j*k>10000:
                break
            else:
                a[i**2+j**2+k**2+i*j+i*k+j*k]+=6
for i in range(1,n+1):
    print(a[i])

Submission status: Accepted

Solution code:
n = int(input())
ans = [0]*n

for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      l = i**2 + j**2 + k**2 + i*j + j*k + k*i
      if l <= n:
        ans[l-1] += 1
      
for m in range(n): 
  print(ans[m])

Submission status: Accepted

Solution code:
from typing import List


def main():
    n = int(input())
    m = xyz(n)
    for i in m:
        print(i)


def xyz(n: int) -> List[int]:
    result = [0] * n
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                m = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if m > n:
                    break
                result[m - 1] += 1

    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from typing import List


def main():
    n = int(input())
    m = xyz(n)
    for i in m:
        print(i)


def f(x, y, z):
    return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


def xyz(n: int) -> List[int]:
    result = [0] * n
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                m = f(x, y, z)
                if m > n:
                    break
                result[m - 1] += 1

    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())

Z=[0]*10005
for i in range(1,102):
    for j in range(1,102):
        for k in range(1,102):
            n=i**2+j**2+k**2+i*j+j*k+k*i
            if n<=N:
                Z[n-1]+=1
for i in range(N):
    print(Z[i])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
dp = [0]*(n+1)

for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      tmp = x*x + y*y + z*z + x*y + y*z + z*x
      if tmp <= n:
        dp[tmp] += 1

for i in range(1, n+1):
  print(dp[i])

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      if v<10050:
        ans[v]+=1
for i in range(n):
  print(ans[i+1])

Submission status: Accepted

Solution code:
n=int(input())
l=[0]*(n+1)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            s=i**2+j**2+k**2+i*k+i*j+j*k
            if(s<=n):
                l[s]+=1
for i in range(1,n+1):
    print(l[i])

Submission status: Accepted

Solution code:
def solve():
  N = int(input())
  ans = [0]*N
  for x in range(1,101):
    for y in range(1,101):
      for z in range(1,101):
        p = x*x + y*y + z*z + x*y + y*z + z*x
        if p <= N:
          ans[p-1] += 1
  return ans
print(*solve(),sep='\n')

Submission status: Accepted

Solution code:
n = int(input())
ans = [0]*(n+1)
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            k = x**2+y**2+z**2+x*y+y*z+z*x
            if k<=n: ans[k]+=1
for i in range(1, n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n = int(input())
ans = [0]*(n+1)
for x in range(1, 103):
    for y in range(1, 103):
        for z in range(1, 103):
            k = x**2+y**2+z**2+x*y+y*z+z*x
            if k<=n: ans[k]+=1
for i in range(1, n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n = int(input())

ans = [0 for _ in range(10005)]

for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            m = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if m < 10005:
                ans[m] += 1

for i in range(n):
    i += 1
    print(ans[i])

Submission status: Accepted

Solution code:
n = int(input())
a = [0] * (n + 1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            c = x * x + y * y + z * z + x * y + y * z + z * x
            if c <= n:
                a[c] +=1
            else:
                break
for i in a[1:]:
    print(i)

Submission status: Accepted

Solution code:
n = int(input())
table = [0]*(10**5)
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            table[x**2+y**2+z**2+x*y+y*z+z*x] += 1

for i in range(1, n+1):
    print(table[i])

Submission status: Accepted

Solution code:
n = int(input())
L = [0 for i in range(10**4+1)]
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            r = x**2 + y**2 + z**2 + x*z + x*y + z*y
            if r <= 10000:
                L[r] += 1
for i in range(1, n+1):
    print(L[i])

Submission status: Accepted

Solution code:
n=int(input())
a=[0]*(n+1)
d=0
for i in range(1,101):
    for j in range(1,101):
        for h in range(1,101):
            c=i**2+j**2+h**2+i*j+j*h+i*h
            if c<=n:
                a[c]+=1
for i in a[1:]:
    print(i)

Submission status: Accepted

Solution code:
n=int(input())
dp=[0]*(10**5)
for x in range(1,10**2):
  for y in range(1,10**2):
    for z in range(1,10**2):
      dp[x**2+y**2+z**2+x*y+y*z+z*x]+=1
for i in range(n):
  print(dp[i+1])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

# C - XYZ Triplets
def calc(x, y, z):
	return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


N = int(input())
ans = [0] * (N + 1)

for x in range(1, 100):
	for y in range(1, 100):
		for z in range(1, 100):
			i = calc(x, y, z)
			
			if i > N:
				break
			else:
				ans[i] += 1

for i in range(1, N + 1):
	print(ans[i])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

# C - XYZ Triplets
def calc(x, y, z):
	return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


N = int(input())
ans = [0] * (N + 1)

for x in range(1, 100):
	for y in range(1, 100):
		for z in range(1, 100):
			i = calc(x, y, z)
			
			if i > N:
				break
			else:
				ans[i] += 1

for i in range(1, N + 1):
	print(ans[i])

Submission status: Accepted

Solution code:
from math import sqrt

N = int(input())
result = [0] * N

n = int(sqrt(N))

for x in range(1, n+1):
    for y in range(1, n+1):
        for z in range(1, n+1):
            check = x**2 + y**2 + z**2 + x * y + y * z + z * x

            if check <= N:
                result[check-1] += 1

for i in result:
    print(i)

Submission status: Accepted

Solution code:
N = int(input())

ans = [0]*(N+1)

root = int(N**0.5)

for x in range(1, root+1):
    for y in range(1, root+1):
        for z in range(1, root+1):
            F = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if F <= N:
                ans[F] += 1
            else:
                continue

for i in range(1, N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())

ans = [0]*N
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            val = x**2+y**2+z**2+x*y+y*z+z*x
            if val<=N:
                ans[val-1] += 1

for v in ans:
    print(v)

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = [0]*(N+1)
Nruto = math.floor(math.sqrt(N))
for x in range(1, Nruto):
    a = x**2
    for y in range(1, Nruto):
        b = y**2
        c = x*y
        for z in range(1, Nruto):
            keisan = a+b+c+z*(z+y+x)
            if keisan > N:
                break
            ans[keisan] += 1
for i in range(1, N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
ya = [0] * 1000001
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            l = x**2 + y**2 + z**2 + x*y + y*z + z*x
            ya[l] += 1
for i in range(1,n+1):
    print(ya[i])

Submission status: Accepted

Solution code:
import itertools
from collections import defaultdict


def main():
    N = int(input())
    A = defaultdict(int)
    for x in range(1, N + 1):
        breakflag = False
        for y in range(1, N + 1):
            for z in range(1, N + 1):
                a = x**2 + y**2 + z**2 + x * y + y * z + z * x
                if a <= N:
                    A[a] += 1
                else:
                    break
    for i in range(N):
        print(A[i + 1])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve():
  N = int(input())
  ans = [0]*N
  for x in range(1,101):
    for y in range(1,101):
      for z in range(1,101):
        p = x*x + y*y + z*z + x*y + y*z + z*x
        if p <= N:
          ans[p-1] += 1
  return ans
print(*solve(),sep='\n')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    N = int(input())

    f = [0] * (10000 + 1)
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if n <= 10000:
                    f[n] += 1

    print("\n".join(map(str, f[1:N + 1])))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
L = [0]*N
for X in range(1,101):
    for Y in range(1,101):
        for Z in range(1,101):
            Num = X*X+Y*Y+Z*Z+X*Y+X*Z+Y*Z
            if Num>N: break
            else: L[Num-1] += 1
print('\n'.join(str(X) for X in L))

Submission status: Accepted

Solution code:
N = int(input())
C = {i:0 for i in range(1,N+1)}
for x in range(1,142):
    for y in range(1,142):
        for z in range(1,142):
            a = (x+y)**2+(y+z)**2+(z+x)**2
            if a%2==0 and a//2<=N:
                C[a//2] += 1
for i in range(1,N+1):
    print(C[i])

Submission status: Accepted

Solution code:
n=int(input())
a=[0]*(n+1)
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      if x*x+y*y+z*z+x*y+x*z+y*z<=n:
        a[x*x+y*y+z*z+x*y+x*z+y*z]+=1
for i in range(1,n+1):
  print(a[i])

Submission status: Accepted

Solution code:
N = int(input())
 
V = [0]*10000
 
for j in range (1, 100):
	for k in range (1, 100):
		for l in range (1, 100):
			if j**2+k**2+l**2+j*k+k*l+j*l < 10001:
				V[j**2+k**2+l**2+j*k+k*l+j*l-1]+=1

for i in range (0, N):
	print(V[i])

Submission status: Accepted

Solution code:
n = int(input())
ansl = [0]*(n+1)
for x in range(1,10**2+1):
    for y in range(1,10**2+1):
        for z in range(1,10**2+1):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v <= n:
                ansl[v] += 1

for a in ansl[1:]:
    print(a)

Submission status: Accepted

Solution code:
n = int(input())
cnt = [0] * 11000

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            value = x*x + y*y + z*z + x*y + y*z + z*x
            if value <= n:
                cnt[value] += 1

for i in range(1,n+1):
    print(cnt[i])

Submission status: Accepted

Solution code:
n = int(input())
cnt = [0]*11000

for x in range(1,101):
    for y in range(1, 101):
        for z in range(1, 101):
            value = x*x + y*y + z*z + x*y + y*z + z*x
            if value <= n:
                cnt[value] += 1

for i in range(1, n+1):
    print(cnt[i])

Submission status: Accepted

Solution code:
N=int(input())
sum=[0]*N
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            a=x*x+y*y+z*z+x*y+y*z+x*z
            if a<=N:
                sum[a-1]=sum[a-1]+1

for i in sum:
    print(i)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
#N,K,d= map(int,input().split())
#A = list(map(int,input().split()))
#S = str(input())
#T = str(input())

num=np.zeros(10**4+1)
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            ans = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if ans < 10**4+1:
                num[ans]+=1


for i in range(N):
    print(int(num[i+1]))

Submission status: Accepted

Solution code:
n = int(input())
ans = [0] * n

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            d = x * x + y * y + z * z + x * y + y * z + z * x
            if d <= n:
                ans[d - 1] += 1

for i in ans:
    print(i)

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
ya = [0] * 100001
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            ya[n] += 1
n = I()
for i in range(1,n+1):
    print(ya[i])

Submission status: Accepted

Solution code:

N = int(input())

ans = [0] * (N + 1)

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n <= N:
                ans[n] += 1

print(*ans[1:], sep="\n")

Submission status: Accepted

Solution code:
N = int(input())

def calc(n):
    ans = [0 for i in range(n+1)]
    for x in range(1,n+1):
        a = x**2
        if a>=n:
            break
        for y in range(1,1+n):
            b = y**2
            if b>=n:
                break
            for z in range(1,1+n):
                c = z**2
                if c>=n:
                    break
                f = a+b+c+x*y+y*z+z*x
                if f>n:
                    break
                ans[f]+=1
    return ans

res = calc(N)
for i in range(N):
    print(res[i+1])

Submission status: Accepted

Solution code:
N = int(input())

ans = [0]*N
for x in range(1,10**2+1):
    for y in range(1,10**2+1):
        for z in range(1,10**2+1):
            p = x**2+y**2+z**2+x*y+y*z+z*x-1
            if p < N:
                ans[p] += 1

[print(i) for i in ans]

Submission status: Accepted

Solution code:
N = int(input())

ans=[0]*(N+1)
t=int(N**0.5+1)
for x in range(1, t):
    for y in range(1, t):
        for z in range(1, t):
            v=x*x+y*y+z*z+x*y+y*z+z*x
            if v<=N: ans[v]+=1
for i in range(1,N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n=int(input())

ans=[0]*(n+1)
r=int(n**0.5)+1

for x in range(1,r):
    for y in range(1,r):
        for z in range(1,r):
            t=x**2+y**2+z**2+x*y+y*z+z*x
            if t <= n:
                ans[t]+=1

for i in ans[1:]:
    print(i)

Submission status: Accepted

Solution code:
import math
N =int(input())
M = int(math.sqrt(N))
ans = [0 for _ in range(10050)]
for j in range(M):
  for k in range(M):
    for l in range(M):
      v = (j+1)**2 + (k+1)**2 + (l+1)**2 + (j+1)*(k+1) + (k+1)*(l+1) + (l+1)*(j+1)
      if (v<=N):
        ans[v] += 1
for i in range(N):
  print(ans[i+1])