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:
import sys
readline = sys.stdin.buffer.readline


N=int(readline())
n=int(pow(N//3,0.5))
cnt=[0]*(N+1)
for i in range(1,n):  
  for j in range(i,n):
    for k in range(j,n):
      if pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i<=N:
        if i==j and j==k and k==i:
          cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=1
        else:
          cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=3
for i in range(1,N):
  print(cnt[i])

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
for n in range(1,N+1):
    cnt = 0
    for x,y in itertools.product(list(range(n)),repeat=2):
        z = n - x - y
        if z < 1: break
        if n == x*x + y*y +z*z + x*y + y*z + z*x:
            cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
for n in range(1,N+1):
    cnt = 0
    for x,y in itertools.product(list(range(n)),repeat=2):
        z = n - x - y
        if n == x*x + y*y +z*z + x*y + y*z + z*x:
            cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
for n in range(3,N+1):
    cnt = 0
    for x,y in itertools.product(list(range(n)),repeat=2):
        z = n - x - y
        if n == x*x + y*y +z*z + x*y + y*z + z*x:
            cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = [0]*(N+1)

for i in range(1, int(N**0.5)+1):
    for j in range(1, 101 - i):
       for k in range(1, 101 - i - j):
            f = i*i + j*j + k*k +i*j + j*k + k*i
            if f <= N:
                ans[f] += 1
print(*ans[1:], sep='\n')

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = [0]*(N+1)

for i in range(1, int(N**0.5)+1):
    for j in range(1, 101 - i):
       for k in range(1, 101 - i - j):
            f = i*i + j*j + k*k +i*j + j*k + k*i
            if f <= N:
                ans[f] += 1
print(*ans, sep='\n')

Submission status: Wrong Answer

Solution code:
N = int(input())

from collections import defaultdict
res = defaultdict(list)

# 解の候補を生成
# x,y,zそれぞれに対して√1000位までやればよさそう
limit = int(1000**.5)+1
for x in range(1, limit):
    for y in range(1, limit):
        for z in range(1, limit):
            f = x**2 + y**2 + z**2 + x*y + y*z + z*x
            res[f].append((x,y,z))

for i in range(1, N+1):
    # 重複組み合わせは除外する
    print(len(set(res[i])))

Submission status: Wrong Answer

Solution code:
N = int(input())

from collections import defaultdict
res = defaultdict(list)

# 解の候補を生成
# x,y,zそれぞれに対して√1000位までやればよさそう
limit = int(1000**.5)+1
for x in range(1, limit):
    for y in range(1, limit):
        for z in range(1, limit):
            f = x**2 + y**2 + z**2 + x*y + y*z + z*x
            res[f].append((x,y,z))

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

N = int(input())
ans = [0 for _ in range(105**3)]
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            idx = i**2 + j**2 + k **2 + i*j + i*k + j*k
for i in range(N):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

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):
            idx = i**2 + j**2 + k **2 + i*j + i*k + j*k
for i in range(N):
  print(ans[i])

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

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):
            idx = i**2 + j**2 + k **2 + i*j + i*k + j*k
            if idx < 10000:
                ans[idx-1] += 1
for i in range(N):
  print(ans[i])

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline
N = int(input())
n_np = np.zeros(10050)
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            idx = i**2 + j**2 + k **2 + i*j + i*k + j*k
            if idx < 10000:
                n_np[idx-1] += 1
for i in range(N):
    print(int(n_np[i]))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())

nn = int(np.sqrt(N))+1
Ans = np.zeros(N,int)
chk = np.arange(2,N+2)

for x in range(1,nn-1):
    for y in range(x,nn-x):
        for z in range(y,nn-x-y+1):
            if x == y:
                if y == z:
                    Ans += 1*(x**2+y**2+z**2+x*y+y*z+z+x == chk)
                else:
                    Ans += 3*(x**2+y**2+z**2+x*y+y*z+z+x == chk)
            elif y == z:
                Ans += 3*(x**2+y**2+z**2+x*y+y*z+z+x == chk)
            else:
                Ans += 6*(x**2+y**2+z**2+x*y+y*z+z+x == chk)
for i in Ans:
    print(i)

Submission status: Wrong Answer

Solution code:
# C - XYZ Triplets
from collections import Counter


def main():
    """
    if x = y = z and n = 10000,
        6 * x^2 = 10000
        x ≈ 40.82 -> lim = 41
    """
    N = int(input())
    calc = lambda x, y, z: x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    cnt = Counter(
        calc(i, j, k) for i in range(1, 42) for j in range(1, 42) for k in range(1, 42)
    )
    res = [cnt[i] for i in range(1, N + 1)]
    print("\n".join(map(str, res)))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# C - XYZ Triplets
from collections import Counter


def main():
    """
    if x = y = z and n = 1000,
        6 * x^2 = 1000
        x ≈ 13.038 -> lim = 14
    """
    N = int(input())
    calc = lambda x, y, z: x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    cnt = Counter(
        calc(i, j, k) for i in range(1, 15) for j in range(1, 15) for k in range(1, 15)
    )
    res = [cnt[i] for i in range(1, N + 1)]
    print("\n".join(map(str, res)))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

num_m = (N-4)//2

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 <= N-1:
                ans[n-1] += 1


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

Submission status: Wrong Answer

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

n= int(input())
# ans = [0]*n
tmp = []

for x in range(1, int(n**0.5)+1):
    for y in  range(1, int(n**0.5)+1):
        for z in range(1, int(n**0.5)+1):
            tmp.append(x**2+y**2+z**2+x*y+y*z+z*x)
cnt = collections.Counter(tmp)

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
n=int(input())

a=[0]*(n)
for j in range(1,n+1):
    for k in range(1,n+1):
        for l in range(1,n+1):
            if j**2+k**2+l**2+j*k+k*l+l*j>n:
                break
            else:
                a[j**2+k**2+l**2+j*k+k*l+l*j-1]+=1

print(a)

Submission status: Wrong Answer

Solution code:
#C
N = int(input())

count = [0 for _ in range(10050)]
for j in range(1, 105):
    for k in range(1, 105):
        for l in range(1, 105):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v < 10050:
                count[v] += 1

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

Submission status: Wrong Answer

Solution code:
#C
import math

N = int(input())


count = [0] * 10100
for j in range(1, 105):
    for k in range(1, 105):
        for l in range(1, 105):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v <= 10050:
                count[v] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())

nums = [0]*n
m = int(n**0.5)+1
for i in range(1,m+1):
  for j in range(i, m+1):
    for k in range(j, m+1):
      t = i**2 + j**2 + k**2 + i*j + j*k + i*k
      if t <= n:
        if i == j and i == k: nums[t-1] += 1
        else: nums[t-1] += 3

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

Submission status: Wrong Answer

Solution code:
#C
import math

N = int(input())


count = [0] * (10010)
for j in range(1, 100):
    for k in range(1, 100):
        for l in range(1, 100):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v <= 10000:
                count[v] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())

nums = [0]*n
m = int(n**0.5)+1
for i in range(1,m+1):
  if i**2//6 >= n: continue
  for j in range(i, m+1):
    if i**2 + j**2 + i*j >= n//2: break
    for k in range(j, m+1):
      t = i**2 + j**2 + k**2 + i*j + j*k + i*k
      if t <= n:
        if i == j and i == k: nums[t-1] += 1
        else: nums[t-1] += 3
        
print(*nums, sep="\n")

Submission status: Wrong Answer

Solution code:
N = int(input())

M = int((N//6)**0.5) #x,y,zがとりうる最大の値を計測

for n in range(1,N+1):
	count = 0
	for x in range(1,M+1):
		#P=x**2+y**2+z**2+x*y+y*z+z*x
		for y in range(1,M+1):
			#Q=x**2+y**2+z**2+x*y+y*z+z*x
			for z in range(1,M+1):
				#R = x**2+y**2+z**2+x*y+y*z+z*x
				if x**2+y**2+z**2+x*y+y*z+z*x == n:
					count = count + 1
				else:
					pass

	print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

M = int((N//6)**0.5) #x,y,zがとりうる最大の値を計測
print(M)

for n in range(1,N+1):
	count = 0
	for x in range(1,M+1):
		#P=x**2+y**2+z**2+x*y+y*z+z*x
		for y in range(1,M+1):
			#Q=x**2+y**2+z**2+x*y+y*z+z*x
			for z in range(1,M+1):
				#R = x**2+y**2+z**2+x*y+y*z+z*x
				if x**2+y**2+z**2+x*y+y*z+z*x == n:
					count = count + 1
				else:
					pass

	print(count)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

def square_root_is_int(i):
  return math.sqrt(i) % 1 == 0

def count_tuples(n):
  if(n < 12):
    return 0
  sum = 0
  if(n % 3 == 0 and square_root_is_int(n / 3)):
    sum += 1
  for x in range(2, n):
    x2 = x ** 2
    if(x2 >= n / 3):
      break
    n2 = n - x2
    if(x2 >= n2 / 2):
      break
    if(n2 % 2 == 0 and square_root_is_int(n2 / 2)):
      sum += 3
    for y in range(x + 1, n2):
      y2 = y ** 2
      z2 = n2 - y2
      if(y2 >= z2):
        break
      if(square_root_is_int(z2)):
        sum += 6
  return sum

for i in range(1, n + 1):
  print(count_tuples(2 * i))

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    res = [0]*(n+1)

    for i in range(1,100):
        for j in range(i,100):
            for k in range(j,100):
                if(i**2 + j**2 + k**2 +i*j+j*k + k*i<=n):
                    res[i**2 + j**2 + k**2 +i*j+j*k + k*i]+=3
                    if(i==j==k):
                        res[i**2 + j**2 + k**2 +i*j+j*k + k*i]-=2

    for i in range(1,n+1):
        print(res[i])
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int (input ())
z = 1
while True:
  if N < (2+z)**2-(1+z+z):
    break
  else:
    z += 1
z -= 1
n = 1
while n < N+1:
  p = 0
  for X in range (z):
    for Y in range (z):
      for Z in range (z):
        if n == (X+Y+Z+3)**2-((X+1)*(Y+1)+(Y+1)*(Z+1)+(Z+1)*(X+1)):
          if X > 0 and Y > 0 and Z > 0:
            p += 1
  print (p)
  n += 1

Submission status: Wrong Answer

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

# C - XYZ Triplets
def get_f(n):
	count = 0
	
	for x in range(1, n):
		if x ** 2 < n:
			for y in range(1, n):
				if x ** 2 + y ** 2 < n:
					for z in range(1, n):
						calc = x ** 2 + y ** 2 + x * y
						
						if calc < n:
							if z ** 2 + y * z + z * x == n - calc:
								print(x, y, z)
								count += 1
		
	return count


N = int(input())

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

Submission status: Wrong Answer

Solution code:
def F(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
dic = [0]*(10**4+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):
            temp = F(x,y,z)
            if temp<10**4+1:
                dic[temp] += 1
            else:
                break
N = int(input())
for x in range(1,N+1):
    print(dic[x])

Submission status: Wrong Answer

Solution code:
def F(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
dic = [0]*(10**4+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):
            temp = F(x,y,z)
            if temp<10**4+1:
                dic[temp] += 1
N = int(input())
for x in range(1,N+1):
    print(dic[x])

Submission status: Wrong Answer

Solution code:
def F(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
dic = [0]*(10**4+1)

for x in range(1,10*2):
    for y in range(1,10**2):
        for z in range(1,10**2):
            temp = F(x,y,z)
            if temp<10**4+1:
                dic[temp] += 1
N = int(input())
for x in range(1,N+1):
    print(dic[x])

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0] * (n + 1)
for x in range(1, int(n**0.5) + 1):
    for y in range(x, int(n**0.5) + 1):
        for z in range(y, int(n**0.5) + 1):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v <= n:
                ans[v] += 1
print(*ans[1:], sep='\n')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

#解説を読んで考えている。
#まず、探索範囲は ceil(√N)程度で良いとされた。
# これはxyzが1以上のため、
# x=最大,yz=1のケースでは、 x*x + 2x + 2 = N となるため。

import io
import sys
import math

def format_multi_line_answer(lst):
    ans = ""
    for y in lst:
        ans += f"{y}\n"
    return ans

#この演算fは、n+1に至るまで都度同じ計算をする。
def f(n):
    v_lst = [0] * (n+1)
    for x in range(1,105):  #ここの最適化も必須（Pythonでは？)
        for y in range(1,105):
            for z in range(1,105):
                # ここでnは f(i)ループのiに相当していた。ジャスト 時に追加する必要はない。
                # if ff(x,y,z) == n:
                v = ff(x,y,z) 
                if v < n:  #よく見る、配列インデックスを直接キーとして利用する発想。
                    v_lst[v] += 1
    return v_lst

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

def solve(n):
    # implement process
    ans_l = []
    
    # ループ処理は一回だけ通す。
    v_lst = f(n)

    # 配列に必要な値が全て乗っている
    for v in v_lst[1:]:
        ans_l.append(v)

    return format_multi_line_answer(ans_l)

def main():
    # input
    n = int(input())
    # process
    ans = str( solve(n) )
    
    # output
    print(ans)
    return ans
        
### DEBUG I/O ###
_DEB = 0   # 1:ON / 0:OFF

_INPUT = """\
"""+str(10000)

_EXPECTED = """\
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0


"""

def logd(str):
    """usage:
    if _DEB: logd(f"{str}")
    """
    if _DEB: print(f"[deb] {str}")

### MAIN ###
if __name__ == "__main__":
    if _DEB:
        sys.stdin = io.StringIO(_INPUT)
        print("!! Debug Mode !!")

    ans = main()

    if _DEB:
        print()
        if _EXPECTED.strip() == ans.strip(): print("!! Success !!")
        else: print(f"!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")

Submission status: Wrong Answer

Solution code:
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 = pow(x,2) + pow(y,2) + pow(z,2) + x*y + y*z + z*x
      if n <= N:
        ans[n] += 1
        
for i in range(1,N):
  print(ans[i])

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = [0]*(10**4+1)

for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = (i**2)+(j**2)+(k**2)+i*j+j*k+k*i
      if v<10**4:
        cnt[v] += 1
for i in range(1,n+1):
  print(cnt[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = [0]*(10**4+1)

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<10**4:
        cnt[v] += 1
for i in range(1,n+1):
  print(cnt[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = [0]*(10**4+1)

for i in range(1,50):
  for j in range(1,50):
    for k in range(1,50):
      v = (i**2)+(j**2)+(k**2)+i*j+j*k+k*i
      if v<10**4:
        cnt[v] += 1
for i in range(1,n+1):
  print(cnt[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = [0]*(10**4+1)

for i in range(1,41):
  for j in range(1,41):
    for k in range(1,41):
      v = (i**2)+(j**2)+(k**2)+i*j+j*k+k*i
      if v<10**4:
        cnt[v] += 1
for i in range(1,n+1):
  print(cnt[i])

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())

n_cnt = [0]*n

for x in range(1, int(sqrt(2*n))+1):
    for y in range(1, x+1):
        for z in range(1, y+1):
            t = (x+y)**2 + (y+z)**2 + (z+x)**2
            if t % 2 == 0 and t // 2 - 1 < n:
                #print(t // 2 - 1)
                if x == y == z:
                    n_cnt[t // 2 - 1] += 1
                else:
                    n_cnt[t // 2 - 1] += 3

for i in range(n):
    print(n_cnt[i])

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())

n_cnt = [0]*n

for x in range(1, int(sqrt(2*n))+1):
    for y in range(1, x+1):
        for z in range(1, y+1):
            t = ((x+y)**2 + (y+z)**2 + (z+x)**2)
            if t % 2 == 0 and t < 2*n:
                #print(t // 2 - 1)
                if x == y == z:
                    n_cnt[t // 2 - 1] += 1
                else:
                    n_cnt[t // 2 - 1] += 3

for i in range(n):
    print(n_cnt[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0] * (n + 1)
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[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
print(*ans, sep='\n')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
ans=[0]*(10**5)
for x in range(int(math.sqrt(n))+1):
  for y in range(int(math.sqrt(n))+1):
    for z in range(int(math.sqrt(n))+1):
      ans[((x+y)**2+(y+z)**2+(z+x)**2)//2-1]+=1

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

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
d = defaultdict(int)
for i in range(1,25):
    for j in range(1,25):
        for k in range(1,25):
            a = i*i+j*j+k*k+i*j+j*k+k*i
            d[a] += 1
N = int(input())
for i in range(1,N):
    print(d[i])

Submission status: Wrong Answer

Solution code:
from math import sqrt as s
n=int(input())
ans=False
for x in range(1,n+1):
    for i in range(1,int(s(x))+1):
        q=0
        for j in range(1,(int(s(x-(i*i)))+1)):
            f=0
            for k in range(1,(int(s(x-(i*i)-(j*j)))+1)):
                if i*i+j*j+k*k+i*j+j*k+k*i==x:
                    if i==1 and j==1 and k==1:
                        print(1)
                    else:
                        print(3)
                    ans=True
                    break
                elif i*i+j*j+k*k+i*j+j*k+k*i>n:
                    f=1
                    break
            if f==1:
                q=1
                break
        if q==1:
            break
    if ans==False:
        print(0)

Submission status: Wrong Answer

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

N = int(readline())

for i in range(1, N + 1):
  ans = 0
  for x in range(1, i + 1):
    if x ** 2 >= i:
      break
    for y in range(x + 1, i + 1):
      if x ** 2 + y ** 2 >= i:
        break
      for z in range(y + 1, i + 1):
        if x ** 2 + y ** 2 + z ** 2 >= i:
          break
        if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == i:
          L = len(set([x,y,z]))
          if L == 3:
            ans += 1
          elif L == 2:
            ans += 3
          else:
            ans += 6
  print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt as s
n=int(input())
for x in range(1,n+1):
    for i in range(1,int(s(x))+1):
        q=0
        for j in range(1,(int(s(x-(i*i)))+1)):
            f=0
            for k in range(1,(int(s(x-(i*i)-(j*j)))+1)):
                if i*i+j*j+k*k+i*j+j*k+k*i==x:
                    if i==1 and j==1 and k==1:
                        print(1)
                    else:
                        print(3)
                    f=1
                    break
                elif i*i+j*j+k*k+i*j+j*k+k*i>n:
                    f=1
                    break
            if f==1:
                q=1
                break
        if q==1:
            break
    if q==0:
        print(0)

Submission status: Wrong Answer

Solution code:
n=int(input())

ans=[0]*10**4

for x in range(1,105):
  for y in range(1,105):
    for z in range(1,105):
      v=(x+y+z)**2-(x*y+y*z+z*x)
      #v=x*x+y*y+z*z+x*y+y*z+z*x
      if v<10**4:
        ans[v]+=1
print(*ans[1:n+1],sep='\n')

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist
print(mylist)

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())

C = Counter()
def solve():
    for x in range(1, N + 1):
        for y in range(x, N + 1):
            res = x * x + y * y + x * y
            if res > N:
                return
            for z in range(y, N):
                s = len({x, y, z})
                if s == 1:
                    cnt = 1
                elif s == 3:
                    cnt = 6
                else:
                    cnt = 3
                C[res + z * z + y * z + x * z] += cnt

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

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())

C = Counter()
def solve():
    for x in range(1, N + 1):
        for y in range(x, N + 1):
            res = x * x + y * y + x * y
            if res > N:
                return
            for z in range(y, N):
                if x == y == z:
                    cnt = 1
                elif x < y < z:
                    cnt = 6
                else:
                    cnt = 3
                C[res + z * z + y * z + x * z] += cnt

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

Submission status: Wrong Answer

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

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

for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = [0 for _ in range(n+1)]

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

for i in ans:
    print(i)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())

res = defaultdict(int)
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
            res[v] += 1

for i in range(n):
    print(res.get(i, 0))

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())

C = Counter()
def solve():
    for x in range(1, N):
        for y in range(x, N):
            res = x * x + y * y + x * y
            if res >= N:
                return
            for z in range(y, N):
                if x == y == z:
                    cnt = 1
                elif x < y < z:
                    cnt = 6
                else:
                    cnt = 3
                C[res + z * z + y * z + x * z] += cnt

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

Submission status: Wrong Answer

Solution code:
n=int(input())
import math
s=int(math.sqrt(n))
for i in range(1,n):
    count = 0
    for x in range(1,s+4):
        for y in range(1,s+4):
            for z in range(1,s+4):
                if x*x+y*y+z*z+x*y+y*z+z*x == i:
                        count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline().rstrip()


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



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

    dp = [0]*(N+1)
    rt = int(N **0.5) +1
    for i in range(1,rt):
        ii = i**2
        for j in range(1,rt):
            jj = j**2
            ij = i*j
            if ii + jj + 1 + ij + i + j  >N:
                break
            for k in range(1,rt):
                kk = k**2
                case =int( ii + jj + kk + ij + i*k + j*k )
                if case <=N:
                    dp[case] +=1
                else:
                    break

    print(*dp[1:N-2], sep="\n")









if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
ans = [0 for _ in range(10001)]
for i in range(101):
  for j in range(101):
    for k in range(101):
      v = i*i + j*j + k*k + i*j + j*k + k*i
      if v < 10001:
        ans[v] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0 for _ in range(n+1)]
def calc(n):
    for x in range(1, int(n**0.5)):
        for y in range(1, int(n**0.5)):
            for z in range(1, int(n**0.5)):
                v = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if v < n+1:
                    ans[v] += 1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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