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: Wrong Answer

Solution code:
n=int(input())
for i in range(1,n+1):
    e=0
    for j in range(1,36):
        if(j*j>=n):
            break
        for k in range(1,36):
            if(k*k>=n):
                break
            for l in range(1,36):
                if(l*l>=n):
                    break
                if((j*j)+(k*k)+(l*l)+(j*k)+(k*l)+(l*j)==i):
                    e=e+1
    print(e)

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(1,n+1):
    e=0
    for j in range(1,11):
        if(j*j>=n):
            break
        for k in range(1,11):
            if(k*k>=n):
                break
            for l in range(1,11):
                if(l*l>=n):
                    break
                if((j*j)+(k*k)+(l*l)+(j*k)+(k*l)+(l*j)==i):
                    e=e+1
    print(e)

Submission status: Wrong Answer

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):
    print(d[i])

Submission status: Wrong Answer

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

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

ans = [0]*(N+1)

upper = math.ceil(math.sqrt(N/6)) + 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

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

Submission status: Wrong Answer

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

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

def solve(n):
    ans = 0
    low = math.floor(math.sqrt(n//6))
    if low <= 0:
        low = 1

    upper = math.ceil(math.sqrt(n//6 + 1)) + 1
    for x in range(low , upper+1):
        for y in range(low , upper+1):
            for z in range(low , upper+1):
                if f(x,y,z) == n:
                    ans += 1

    print(ans)

for i in range(1, N+1):
    solve(i)

Submission status: Wrong Answer

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

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

def solve(n):
    ans = 0
    low = math.floor(math.sqrt(n//6))
    if low <= 0:
        low = 1
        
    upper = math.ceil(math.sqrt(n//6 + 1))
    for x in range(low , upper+1):
        for y in range(low , upper+1):
            for z in range(low , upper+1):
                if f(x,y,z) == n:
                    ans += 1

    print(ans)

for i in range(1, N+1):
    solve(i)

Submission status: Wrong Answer

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: Wrong Answer

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

    count_list = [0] * n
    upper = int(n**0.5) + 1
    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: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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(len(ans)):
  print(ans[i])

Submission status: Wrong Answer

Solution code:
N = int(input())

for n in range(1, N+1):
  cnt = 0
  for x in range(100):
    for y in range(100):
      for z in range(100):
        if (x + y + z) ** 2 - (x * y) - (y * z) - (z * x) == n:
          cnt += 1
          
print(cnt)

Submission status: Wrong Answer

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

for x in range(1,int(n**.5)+1):
    for y in range(1,int(n**.5)+1):
        for z in range(1,int(n**.5)+1):
            a = x*x+y*y+z*z+x*y+y*z+z*x
            if a < n:
                ans[a] += 1
for i in range(n):
    print(ans[i])

Submission status: Wrong Answer

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):
    print(a[i])

Submission status: Wrong Answer

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,58):
    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: Wrong Answer

Solution code:
n = int(input())
ans = [0]*n
 
for l in range(1,n+1):
  for i in range(1,101):
    for j in range(1,101):
      for k in range(1,101):
        if i**2 + j**2 + k**2 + i*j + j*k + k*i == l:
          ans[(l-1)] += 1
        elif i**2 + j**2 + k**2 + i*j + j*k + k*i > l:
          break 
    if i**2 + j**2 + k**2 + i*j + j*k + k*i > l:
      break 
  if i**2 + j**2 + k**2 + i*j + j*k + k*i > l:
    break 

for m in range(n):      
   print(ans[(m)])

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0]*n
n1 = int(n/6)+2

for l in range(1,n+1):
  for i in range(1,n1):
    for j in range(1,n1):
      for k in range(1,n1):
        if i**2 + j**2 + k**2 + i*j + j*k + k*i == l:
          ans[(l-1)] += 1
        elif i**2 + j**2 + k**2 + i*j + j*k + k*i > l:
          break 
    if i**2 + j**2 + k**2 + i*j + j*k + k*i > l:
      break 
  if i**2 + j**2 + k**2 + i*j + j*k + k*i > l:
    break 

for m in range(n):      
   print(ans[(m)])

Submission status: Wrong Answer

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
for i in range(N+1):
    print(Z[i])

Submission status: Wrong Answer

Solution code:
# cook your dish here
N=int(input())
count=0
xyz=list(range(111,1000))
for i in range(0,N):
    for j in range(0,len(xyz)):
        
        element=xyz[j]
        str_ele=str(element)
        list_ele=list(str_ele)
        x=int(list_ele[0])
        y=int(list_ele[1])
        z=int(list_ele[2])
        Expression=int(x**2+y**2+z**2+x*y+y*z+z*x)
        if(Expression == N):
            count+=1
            print(count)
        else:
            print("0")

Submission status: Wrong Answer

Solution code:
n = int(input())
L = [0 for i in range(10**4+1)]
for x in range(1, 45):
    for y in range(1, 45):
        for z in range(1, 45):
            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: Wrong Answer

Solution code:
n = int(input())
L = [0 for i in range(10**4+1)]
for x in range(1, 45):
    for y in range(1, 45):
        for z in range(1, 45):
            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):
    print(L[i])

Submission status: Wrong Answer

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(n+1):
    print(cnt[i])

Submission status: Wrong Answer

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(n):
    print(cnt[i])

Submission status: Wrong Answer

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(n+1):
    print(cnt[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
sum=[0]*N
for x in range(1,N):
    for y in range(1,N):
        for z in range(1,N):
            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(sum)

Submission status: Wrong Answer

Solution code:
N=int(input())
sum=[0]*N
for x in range(1,N):
    for y in range(1,N):
        for z in range(1,N):
            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 range(N):
    print(sum[i-1])

Submission status: Wrong Answer

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: Wrong Answer

Solution code:

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


def main():
    
    n = int(input())
    NumTriples = [0] * n

    for x in range(1,int(n/3)):
        for y in range(1,int(n/3)):
            for z in range(1,int(n/3)):
                print(x,y,z)
                res = CalculateEq(x,y,z)
                print(res)
                if res < n:
                    print(res)
                    NumTriples[res - 1] += 1
                    print(NumTriples)
                else:
                    break
        if x==y and x==z and res > n:
            break
        
    for item in NumTriples:
        print(item)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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+1):
    print(res[i])

Submission status: Wrong Answer

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])

Submission status: Wrong Answer

Solution code:
from itertools import product

N = int(input())
l = list(product(range(1, N + 1), repeat=3))

def f(n: int) -> int:
    cnt = 0
    for i in range(N):
        x, y, z = l[i]
        if x < 1 or y < 1 or z < 1:
            continue
        if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
            cnt += 1

    return cnt

for n in range(1, N+1):
    print(f(n))

Submission status: Wrong Answer

Solution code:
import math
N =int(input())
for i in range(N-1):
  count = 0
  M = int(math.sqrt(i+1))
  for j in range(M-1):
    for k in range(M-1):
      for l in range(M-1):
        if((j+1)**2 + (k+1)**2 + (l+1)**2 + (j+1)*(k+1) + (k+1)*(l+1) + (l+1)*(j+1) == i+1):
          count+=1
  print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
res=[0] * 10000
for x in range(1,42):
    for y in range(1,42):
        for z in range(1,42):
            k=x*x+y*y+z*z+x*y+y*z+z*x
            if k>10000: continue
            res[k-1]+=1
for i in range(N):
    print(res[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
res=[0] * 10000
for x in range(1,42):
    for y in range(x,42):
        for z in range(y,42):
            k=x*x+y*y+z*z+x*y+y*z+z*x
            if k>10000: continue
            if x==y and y==z:
                res[k-1]+=1
            elif x!=y and y!=z and z!=x:
                res[k-1]+=6
            else:
                res[k-1]+=3
for i in range(N):
    print(res[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
res=[0] * 10000
for x in range(1,42):
    for y in range(x,42):
        for z in range(y,42):
            k=x*x+y*y+z*z+x*y+y*z+z*x
            if k>10000: continue
            if x==y and y==z:
                res[k]+=1
            elif x!=y and y!=z and z!=x:
                res[k]+=6
            else:
                res[k]+=3
for i in range(N):
    print(res[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0]*(N+1)
for x in range(1,80):
    for y in range(1,80):
        for z in range(1,80):
            tmp = x**2 + y**2 + z**2 +x*y + y*z + z*x
            if tmp > N:
                continue
            ans[tmp]+=1
for i in range(1,N+1):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0]*(N+1)
for x in range(1,46):
    for y in range(1,46):
        for z in range(1,46):
            tmp = x**2 + y**2 + z**2 +x*y + y*z + z*x
            if tmp > N:
                continue
            ans[tmp]+=1
for i in range(1,N+1):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
n_list = []
count = 1
max_val = 1
res = 0
for x in range(1,42):
    for y in range(x,42):
        for z in range(y,42):
            res = x**2 +y**2 + z**2 + x*y + y*z + z*x
            for i in range(int(x!=y) + int(y!=z) + int(z!=x)-1):
                count *= 3-i
            if max_val < res:
                for i in range(max_val, res+1):
                    if i != res: n_list.append(0)
                    else: n_list.append(count)
                max_val = res+1
            else:
                n_list[res-1] += count
            count = 1

            

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

Submission status: Wrong Answer

Solution code:
def sum_(x,y,z):
  return (((x+y)**2)+((y+z)**2)+((x+z)**2))//2
n=int(input())
l=[0]*(n+1)
i=1
k=[]
while(sum_(i,i,i)<=n):
  z=1
  while(sum_(i,i,z)<=n):
    if (i==z):
      l[sum_(i,i,z)]+=1
    else:

      l[sum_(i,i,z)]+=3
      k.append([i,i,z])
      k.append([i,z,i])
      k.append([z,i,i])
    z+=1
  i+=1
i=1
while( sum_(i,i,i)<=n):
  z=1
  while(z<n and sum_(i,z,z)<=n and ([i,z,z] not in k)):
    if (i==z):
      pass
    else:

      l[sum_(i,z,z)]+=3
    z+=1
  i+=1
i=1
while(i<n and sum_(i,i+1,i+2)<=n):
  y=i+1
  while(y<n and sum_(i,y,y+1)<=n):
    z=y+1
    while(z<n and sum_(i,y,z)<=n):
      l[sum_(i,y,z)]+=6
      z+=1
    y+=1
  i+=1
for i in l[1:]:
  print(i)

Submission status: Wrong Answer

Solution code:
def sum_(x,y,z):
  return (((x+y)**2)+((y+z)**2)+((x+z)**2))//2
n=int(input())
l=[0]*(n+1)
i=1
k=[]
while(i<n and sum_(i,i,i)<=n):
  z=1
  while(z<n and sum_(i,i,z)<=n):
    if (i==z):
      l[sum_(i,i,z)]+=1
    else:
      l[sum_(i,i,z)]+=3
      k.append([i,i,z])
    z+=1
  i+=1
i=1
while(i<n and sum_(i,i,i)<=n):
  z=1
  while(z<n and sum_(i,z,z)<=n and ([i,z,z] not in k)):
    if (i==z):
      pass
    else:
      l[sum_(i,z,z)]+=3
    z+=1
  i+=1
i=1
while(i<n and sum_(i,i+1,i+2)<=n):
  y=i+1
  while(sum_(i,y,y+1)<=n):
    z=y+1
    while(sum_(i,y,z)<=n):
      l[sum_(i,y,z)]+=6
      z+=1
    y+=1
  i+=1
for i in l[1:]:
  print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
n_list = []
count = 1
max_val = 1
res = 0
for x in range(1,42):
    for y in range(x,42):
        for z in range(y,42):
            res = x**2 +y**2 + z**2 + x*y + y*z + z*x
            for i in range(int(x!=y) + int(y!=z) + int(z!=x)-1):
                count *= 3-i
            
            if max_val < res:
                for i in range(max_val, res+1):
                    # if i >= N: break
                    if i != res: n_list.append(0)
                    else: n_list.append(count)
            else:
                n_list[res-1] += count
            count = 1

            max_val = res+1

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

Submission status: Wrong Answer

Solution code:
def sum_(x,y,z):
  return (((x+y)**2)+((y+z)**2)+((x+z)**2))//2
n=int(input())
l=[0]*(n+1)
i=1
while(i<n and sum_(i,i,i)<=n):
  z=1
  while(z<n and sum_(i,i,z)<=n):
    if (i==z):
      l[sum_(i,i,z)]+=1
    else:
      l[sum_(i,i,z)]+=3
    z+=1
  i+=1
i=1
while(i<n and sum_(i,i,i)<=n):
  z=1
  while(z<n and sum_(i,z,z)<=n):
    if (i==z):
      pass
    else:
      l[sum_(i,z,z)]+=3
    z+=1
  i+=1
i=1
while(i<n and sum_(i,i+1,i+2)<=n):
  y=i+1
  while(sum_(i,y,y+1)<=n):
    z=y+1
    while(sum_(i,y,z)<=n):
      l[sum_(i,y,z)]+=6
      z+=1
    y+=1
  i+=1
for i in l[1:]:
  print(i)

Submission status: Wrong Answer

Solution code:
def sum_(x,y,z):
  return (((x+y)**2)+((y+z)**2)+((x+z)**2))//2
n=int(input())
l=[0]*(n+1)
i=1
while(i<n and sum_(i,i,i)<=n):
  z=1
  while(z<n and sum_(i,i,z)<=n):
    if (i==z):
      l[sum_(i,i,z)]+=1
    else:
      l[sum_(i,i,z)]+=3
    z+=1
  i+=1
i=1
while(i<n and sum_(i,i+1,i+2)<=n):
  y=i+1
  while(sum_(i,y,y+1)<=n):
    z=y+1
    while(sum_(i,y,z)<=n):
      l[sum_(i,y,z)]+=6
      z+=1
    y+=1
  i+=1
for i in l[1:]:
  print(i)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())

d = defaultdict(int)

for x in range(1,N+1):
    for y in range(x,N+1):
        for z in range(y,N+1):
            n = x**2+y**2+z**2+x*y+y*z+z*x
            if x == y == z:
                d[n] += 1
            elif x == y or y == z or z == x:
                d[n] += 3
            else:
                d[n] += 6
            
            if n > N:
                break
        else:
            continue
        break
    else:
        continue
    break

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

Submission status: Wrong Answer

Solution code:
n=int(input())
j=10501
l=[0 for i in range(j)]
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+y*x+x*z+z*y
      if(v<j):
        l[v]+=1
for i in range(n+1):
  print(l[i+1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
n = int(math.sqrt(N))
ans = [0 for _ in range(N)]

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

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

Submission status: Wrong Answer

Solution code:
#! python3
# coding:utf-8
 
def main():
    n = int(input())
    ans = [0 for _ in range(n)]
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                eq = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if eq < n+1:
                    ans[eq-1]+=1
    print(ans)
    for i in range(len(ans)):
        print(i,ans[i])    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#! python3
# coding:utf-8
 
def main():
    n = int(input())
    ans = [0 for _ in range(n+1)]
    for x in range(1,101):
        for y in range(1,101):
            for z in range(1,101):
                eq = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if eq < n+1:
                    ans[eq]+=1

    for i in ans:
        print(i)    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#! python3
# coding:utf-8
 
def main():
    n = int(input())
    ans = [0 for _ in range(n+1)]

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

    for i in ans:
        print(i)    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#! python3
# coding:utf-8

n = int(input())
for i in range(1,n+1):
    cnt=0

    for x in range(1,n+1):
        if x < 100:
            continue
        for y in range(1,n-x+1):
            for z in range(1,n-x-y+1):
                eq = x**2 + y**2 + z**2 + x*y + y*z + z*x
                   
                if eq == i:
                    cnt+=1
    print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = [0]*(N)
lim = int(N**0.5 + 1)
for i in range(1,lim):
    for j in range(1,lim):
        for k in range(1,lim):
            num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1
            if num < N:
                arr[num - 1] += 1

print(*arr, sep='\n')

Submission status: Wrong Answer

Solution code:
N = int(input())
def f(n):
    ans = 0
    for x in range(1, n):
        for y in range(1, n):
            for z in range(1, n):
                if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
                    ans += 1
    return ans
for n in range(N):
    print(f(n))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
UpLim = math.floor(math.sqrt(N))
cnt = 0

for i in range(N+1):
  cnt = 0
  for j in range(1, UpLim + 1):
    for k in range(1, UpLim + 1):
      for l in range(1, UpLim + 1):
        if j**2 + k**2 + l**2 + j*k + k*l + l*j == i:
          cnt += 1
  print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

for x in range(N+1):
  count = 0
  for i in range(1, 100):
    if (i**2 + i + i > x):
      continue

    for j in range(1, 100):
      if (i**2 + j**2 + i*j + j + i > x):
        continue
      
      for k in range(1, 100):
        if ((i**2 + j**2 + k**2 + i*j + j*k + k*i) == x):
          count += 1
          break

        if ((i**2 + j**2 + k**2 + i*j + j*k + k*i) > x):
          break

  print(count)

Submission status: Wrong Answer

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

def get_ans(n):
  cnt = 0
  for x in range(1, 101):
    for y in range(1, 101):
      for z in range(1, 101):
        k = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if(k <= 10000):
          ans[k] += 1        
  return ans

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

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    ans = [0 for i in range(N + 1)]

    for x in range(1, 50):
        for y in range(1, 50):
            for z in range(1, 50):
                s = x**2 + y**2 + z**2 + x*y + y*z + z*x

                if 1 <= s <= N:
                    ans[s] += 1

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    ans = [0 for i in range(N + 1)]

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
cnt=[0]*500000
print(2*10**2)
for i in range(1,2*10**2+1):
    for j in range(1,2*10**2+1):
        for k in range(1,2*10**2+1):
            cnt[((i+j)**2+(j+k)**2+(k+i)**2)//2-1]+=1
for i in range(n):
    print(cnt[i])

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
cnt=[0]*500000
print(2*10**2)
for i in range(1,2*10**2+1):
    for j in range(1,2*10**2+1):
        for k in range(1,2*10**2+1):
            if i==j and j==k:
                cnt[((i+j)**2+(j+k)**2+(k+i)**2)//2-1]+=1
            elif i==j or j==k or k==i:
                cnt[((i+j)**2+(j+k)**2+(k+i)**2)//2-1]+=3
            else:
                cnt[((i+j)**2+(j+k)**2+(k+i)**2)//2-1]+=6
for i in range(n):
    print(cnt[i])

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for N in range(1,n+1):
  for i in range(1,2*10**2+1):
    for j in range(1,2*10**2+1):
      for k in range(1,2*10**2+1):
        if (i+j)**2+(j+k)**2+(k+i)**2==2*N:
          ans+=1
  print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for N in range(1,n+1):
  for i in range(1,10**2+1):
    for j in range(1,10**2+1):
      for k in range(1,10**2+1):
        if (i+j)**2+(j+k)**2+(k+i)**2==2*N:
          ans+=1
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
for n in range(N+1):
  cnt=0
  x=x2=1
  while x2<=n:
    y=y2=1
    while x2+y2+(x*y)<=n:
      z=z2=1
      while x2+y2+z2+(x*y)+(x*z)+(y*z)<=n:
        if  x2+y2+z2+(x*y)+(x*z)+(y*z)==n:
          cnt+=1
        z+=1
        z2=z**2
      y+=1
      y2=y**2
    x+=1
    x2=x**2
  print(cnt)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
d = defaultdict(int)
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):
                d[n]+=1
for i in range(1,N+1):
    print(d[i])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from itertools import accumulate
import copy


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline()[:-1] for _ in range(line)]


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

Submission status: Wrong Answer

Solution code:
def count(num, x, y, z):
  temp = x*x + y*y + z*z + x*y + y*z + z*x
        
  if temp == num:
    if x==y and x==z:
      return 1
    else:
      return 3

  return 0
  
N=int(input())
number=0
for i in range(1,N+1):
  number += count(i, 1, 1, 1)
  number += count(i, 2, 1, 1)
  number += count(i, 2, 2, 1)
  number += count(i, 2, 2, 2)
  number += count(i, 3, 1, 1)
  number += count(i, 3, 2, 1)
  number += count(i, 3, 2, 2)
  number += count(i, 3, 3, 2)
  number += count(i, 3, 3, 3)
  number += count(i, 4, 1, 1)
  number += count(i, 4, 2, 1)
  number += count(i, 4, 2, 2)
  number += count(i, 4, 3, 1)
  number += count(i, 4, 3, 2)
  number += count(i, 4, 3, 3)
  number += count(i, 4, 4, 1)
  number += count(i, 4, 4, 2)
  number += count(i, 4, 4, 3)
  print(number)
  number=0

Submission status: Wrong Answer

Solution code:
def count(num, x, y, z):
  temp = x*x + y*y + z*z + x*y + y*z + z*x
        
  if temp == num:
    if x==y and x==z:
      return 1
    else:
      return 3

  return 0
  
N=int(input())
number=0
for i in range(1,N+1):
  number += count(i, 1, 1, 1)
  number += count(i, 2, 1, 1)
  number += count(i, 2, 2, 1)
  number += count(i, 2, 2, 2)
  number += count(i, 3, 1, 1)
  number += count(i, 3, 2, 1)
  number += count(i, 3, 2, 2)
  number += count(i, 3, 3, 2)
  number += count(i, 3, 3, 3)
  print(number)
  number=0

Submission status: Wrong Answer

Solution code:
def main():
        
    import math
    import numpy as np

    N = int(input())

    n_list = [i + 1 for i in range(N + 1)]
    n_np = np.array(n_list, dtype=np.int64)

    
    for n in n_np:
    # for n in range(1, N + 1):

        max_itr = min(100, int(math.sqrt(n)) + 1)
        
        x_list = [i + 1 for i in range(max_itr)]
        x_np = np.array(x_list, dtype=np.int64)
        
        
        ans = 0

        for x in x_np:        
        # for x in range(1, max_itr):

            for y in x_np:        
            # for y in range(1, max_itr):
            
                # for z in range(1, max_itr):
                for z in x_np:        

                    left_eq = x * x + y * y + z * z + x * y + y * z + z * x
                    if (left_eq == n):
                        ans += 1
        
        
        print(ans)


if __name__ == '__main__':
    main()