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:
def main():
    n = int(input())
    for i in range(n):
        calc(i)
 
def calc(n):
    count = 0
    for x in range(1, n + 1):
        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+1:
                     count += 1
                if a > n+1:
                    break
    print(count)
    return

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for i in range(1,n+1):
  cnt=0
  for x in range(1,101):
    if x**2>i:
      break
    for y in range(1,x+1):
      if x**2+y**2>i:
        break
      for z in range(1,y+1):
        if x**2+y**2+z**2+x*y+y*z+z*x==i:
          cnt+=3
  ans=cnt
  if i==6:
    ans=1
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

keys = [i for i in range(1, N+1)]
values = [0] * N
count_dict = dict(zip(keys, values))

for x in range(1, N//6+7):
    for y in range(x, N//6+7):
        for z in range(y, N//6+7):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n > N:
                break
            count_dict[n] += 3
            if x == y and y == z:
                count_dict[n] -= 2

for v in count_dict.values():
    print(v)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

def counter(N):
    global count
    max_num = int(math.sqrt(N))
    for x in range(1, max_num + 1):
        for y in range(1, max_num + 1):
            for z in range(1, max_num + 1):
                if x * x + y * y + z * z + x * y + y * z + z * x == N:
                    count += 1
    print(count)

for i in range(N + 1):
    count = 0
    counter(i)

Submission status: Wrong Answer

Solution code:
n = int(input())

nums = [0]*n
m = n//6
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
      else: break

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

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement
N = int(input())
choise = [1]
for i in range(1,N+1):
    if (choise[-1]*6) < i:
        choise.append(choise[-1]+1)
    for j in combinations_with_replacement(choise,3):
        n = j[0]**2+j[1]**2+j[2]**2+j[0]*j[1]+j[1]*j[2]+j[0]*j[2]
        if n == i:
            if j[0]==j[1] and j[1]==j[2]:print(1)
            else:print(3)
            break

Submission status: Wrong Answer

Solution code:
N = int(input())
N_max = N+1

def func(N_max):
#     print(f'N_max:{N_max}')
    cnt = 0
    flag = False

    for x in range(1, N_max):
        if flag:
            break
        for y in range(x, N_max):
            if flag:
                break

            for z in range(y, N_max):
                total = x**2 + y**2+z**2+x*y+y*z+z*x
#                 print(f'{total}')
                if N_max < total:
                    flag = True
                    break
                elif N_max == total:
                    count = len(set([x, y, z]))
#                     print(f'{x},{y},{z}')
                    if count == 1:
                        cnt = 1
                    elif count == 2:
                        cnt = 3
                    else:
                        cnt = 6
                        
    print(f'{cnt}')
    return

for i in range(1, N_max):
    func(i)

Submission status: Wrong Answer

Solution code:
N = int(input())

l = [0 for _ in range(N)]
for x in range(1, 10**2):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            m = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if m <= N:
                if x == y == z:
                    l[m - 1] = 1
                elif x == y or y == z or z == x:
                    l[m - 1] = 3
                else:
                    l[m - 1] = 6

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

Submission status: Wrong Answer

Solution code:
def foo(x,y,z):
    return x*(x+y) + y*(y+z) + z*(z+x)

N = int(input())

F = [0 for i in range(N)]

for i in range(1,N//6+1):
    for j in range(1,N//6+1):
        for k in range(1,N//6+1):
            X = foo(i,j,k)
            if X <= N:
                F[X] += 1

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

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    for i in range(n):
        calc(i)
 
def calc(n):
    count = 0
    for x in range(1, n + 1):
        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+1:
                     count += 1
                if a > n:
                    break
    print(count)
    return

Submission status: Wrong Answer

Solution code:
""" C
    https://atcoder.jp/contests/aising2020/tasks/aising2020_c
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

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

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def main(N):
    for n in range(1, N+1):
        count = 0
        maxi = int(math.sqrt(N))
        x = 1
        for x in range(1, maxi):
            for y in range(1, maxi):
                # z^2 + (x + y) * z = n - pow(x, 2) - pow(y, 2) - x * y
                # z^2 + 2 * z = 3
                a = n - pow(x, 2) - pow(y, 2) - x * y
                z = 0
                for z in range(1, maxi):
                    if pow(z, 2) + (x+y)*z == a:
                        count += 1
                    z += 1
                y += 1
            x += 1
        print(n, count)

if __name__ == "__main__":
    _N = readInteger()

    main(_N)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = [0]*(10**5+1)
for i in range(1,51):
    for j in range(1,51):
        for k in range(1,51):
            num[(i**2 + j**2 + k**2 + i*j + j*k + k*i)] += 1
for i in range(1,n+1):
    print(num[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
mul=1
while ans<=N:
    ans=6*(mul**2)
    mul+=1
ANS={}
for i in range(1,mul+3):
    for j in range(i,mul+3):
        for k in range(j,mul+3):
            if i!=j and j!=k and k!=i:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=6
            elif i==j and j==k and k==i:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=1
            else:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=3
for Z in range(1,N+1):
    if Z in ANS.keys():
        print(ANS[Z])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n+1):
    cnt = 0
    for x in range(1, 34):
        for y in range(1, 34):
            for z in range(1, 34):
                n = x*x + y*y + z*z + x*y + y*z + z*x
                if i == n:
                    cnt += 1
    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
for i in range(1,N+1):
    count = 0
    for x in range(1,int(math.sqrt(i)/6)+2):
        for y in range(x,int(math.sqrt(i)/3)+2):
            for z in range(y,int(math.sqrt(i))+1):
                if x**2+y**2+z**2+x*y+y*z+z*x != i:
                    continue
                if x == y and x == z:
                    count += 1
                elif x == y or x == z or y == z:
                    count += 3
                else:
                    count += 6
    print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())

for i in range(1,n+1):
  count = 0
  x = 1
  for y in range(1,101):
    if (x+y)**2 > 2*i:
      break
    for z in range(y,101):
      fn = (x+y)**2 + (y+z)**2 + (z+x)**2
      if fn > 2*i:
        break
      if fn == 2*i:
        if x != y and y != z and z != x:
          count = 6
        elif z != y and (y == 1 or z == 1):
          count = 3
        elif z == y and (y != 1):
          count = 3
        else:
          count = 1
          
  print(count)

Submission status: Wrong Answer

Solution code:

import math
n = int(input())

sqn = int(math.sqrt(n))+1
count = 0
aset = [0]*(n+1)
for x in range(1,sqn):
    for y in range(x,sqn):
        for z in range(y,sqn):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <= n:
                if x == y and y ==z:
                    aset[a] +=1
                else:
                    aset[a] +=3

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

Submission status: Wrong Answer

Solution code:
from itertools import combinations, combinations_with_replacement
from math import sqrt


n = int(input())
ans = [0] * (n + 1)
for x, y, z in combinations_with_replacement(range(1, int(sqrt(n))), 3):
    i = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    if i <= n:
        if x == y == z:
            ans[i] += 1
        elif all([not(s != t) for s, t in combinations([x, y, z], 2)]):
            ans[i] += 6
        else:
            ans[i] += 3

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

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    for i in range(n):
        calc(i)
 
def calc(n):
    count = 0
    for x in range(1, n + 1):
        if x ** 2 > n:
            break
        for y in range(1, n + 1):
            if y ** 2 > n:
                break
            for z in range(1, n + 1):
                a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if a == n+1:
                     count += 1
                if a > n:
                    break
    print(count)
    return

Submission status: Wrong Answer

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# 約数生成
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

n = ir()
for i in range(1,n+1):
    ans = 0
    maxn = int(math.sqrt((i//6)))
    for x in range(1,maxn+1):
        ret = i - x*x
        maxy = (-x+int(math.sqrt(x*x+3*ret)))//3
        for y in range(1,maxy+1):
            ret2 = ret-y*y-y*x
            r = (x+y)**2 + 4*ret2
            if r == int(math.sqrt(r))**2:
                if (math.sqrt(r)-(x+y))%2 == 0 and ret2 > 0:
                    z = (math.sqrt(r)-(x+y))//2
                    if x != y and y != z:
                        ans+=6
                    elif not (x == y and y == z):
                        ans+=3
                    else:
                        ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque

def getInts():
    return [ int(x) for x in input().split() ]

cache = {}

def f(x,y,z):
    if (x,y,z) in cache:
        return cache[(x,y,z)]
    r = x**2+y**2+z**2+x*y+y*z+z*x
    cache[(x,y,z)] = r
    return r

[N] = getInts()
Q = deque([(0,0,0)])
V = set()
l = [f(0,0,0)]
ans = {}
while True:
    x,y,z = Q.pop()
    l = list(filter(lambda x: x not in V and x[0]>=1 and x[1]>=1 and x[2]>=1, [ (x+1,y,z),(x,y+1,z),(x,y,z+1),(x+1,y+1,z+1) ]))
    for v in l:
        V.add(v)
        Q.appendleft(v)
    l2 = list(map(lambda x: f(*x), l))
    i = 0
    for v in l2:
        if v not in ans:
            ans[v] = 1
        else:
            ans[v] += 1
    if min(l2) > N:
        break
    l = l2
for i in range(1, N+1):
    if i not in ans:
        print(0)
    else:
        print(ans[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
def cul(x, y, z):
    return(x**2 + y**2 + z**2 + x*y + y*z + z*x)

for n in range(1, N+1):
    m = 0
    ma = int((n**0.5)//1)
    print(n, ma)
    ans = 0
    for x in range(1, ma + 1):
        for y in range(1, ma + 1):
            for z in range(1, ma + 1):
                a = cul(x, y, z)
                if a == n:
                    ans += 1
                if a > n:
                    break
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
from itertools import combinations_with_replacement

def calc(t):
    return t[0]*t[0] + t[1]*t[1] + t[2]*t[2] + t[0]*t[1] + t[1]*t[2] + t[2]*t[0]


n = int(input())
ans = [0]*n
n_root = math.floor(math.sqrt(n))

for pattern in combinations_with_replacement(range(1, n_root + 1), 3):
    pattern = list(pattern)
    buf = calc(pattern)
    if buf < n:
        if pattern[0] == pattern[1] == pattern[2]:
            ans[buf-1] += 1
        elif pattern[0] == pattern[1] or pattern[1] == pattern[2] or pattern[0] == pattern[2]:
            ans[buf-1] += 3
        else:
            ans[buf-1] += 6

[print(a) for a in ans]

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=0
for j in range (N):
    if j**3<=N and (j+1)**3>=N:
        n=j+1
        break
for a in range (1,n+2):
    for b in range(1,n+2):
        for c in range(1,n+2):
            s.append(a*a+b*b+c*c+a*b+b*c+c*a)
s.sort()

for l in range(1,N+1):
    print(s.count(l))

Submission status: Wrong Answer

Solution code:
N = int(input())

result = [0] * N
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            temp = pow(x+y, 2) + pow(y+z, 2) + pow(z+x, 2)
            n = temp / 2
            if not n.is_integer():
                continue
            n = int(n)
            if n >= N:
                break
            result[n-1] += 1

for r in result:
    print(r)

Submission status: Wrong Answer

Solution code:
n = int(input())

n_list = [0]*50000
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            if (x+y+z)*(x+y+z) >= 150:
                break
            index = x*x + y*y + z*z + x*y + y*z + z*x
            n_list[index] = n_list[index]+1

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

Submission status: Wrong Answer

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

n = int(input())

for i in range(n + 1):
    s = 0
    p = math.floor(n / 6) + 1
    if i > 5:
        for x in range(1, p + 1):
            for y in range(1, p + 1):
                for z in range(1, p + 1):
                    if (x**2) + (y**2) + (z**2) + (x*y) + (y*z) + (z*x) == i:
                        s += 1
    print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
#print(n)

ptn = [0 for _ in range(20000)]


for x in range(1, 125):
    for y in range(1, 125):
        for z in range(1, 125):
            if x+y+z <= 101:
                ptn[x**2 + y**2 + z**2 + x*y + y*z + x*z] += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

l = [0 for _ in range(N)]
for x in range(1, 10**2):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            m = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if m <= N:
                if x == y == z:
                    l[m - 1] = 1
                elif x == y or y == z or z == x:
                    l[m - 1] = 3
                else:
                    l[m - 1] = 6
            else:
                break

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

Submission status: Wrong Answer

Solution code:
import itertools
import pprint

n = int(input())

result = [0]*15000
maxnum = 50
xlist, ylist, zlist = range(1, maxnum), range(1, maxnum), range(1, maxnum)
p = itertools.product(xlist, ylist, zlist)
for each in p:
    x, y, z = each
    result[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1

print('\n'.join([str(each) for each in result[:n]]))

Submission status: Wrong Answer

Solution code:
import math

N=int(input())
count=[0]*(N+1)
for i in range(1,N+1):
  for x in range(1,int(math.sqrt((N+1)/3))):
    for y in range(1,int(math.sqrt((N+1)/3))):
      for z in range(1,int(math.sqrt((N+1)/3))):
        if(x**2+y**2+z**2+x*y+y*z+z*x==i):
          count[i]+=1
  print(count[i])

Submission status: Wrong Answer

Solution code:
import math  # noqa: F401
from collections import deque  # noqa: F401
from typing import Deque, Dict, List, Optional, Tuple, Union  # noqa: F401


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


def main(N: int):
    for n in range(1, N + 1):
        cnt = 0
        for x in range(1, int(math.sqrt(n))):
            for y in range(x, int(math.sqrt(n))):
                if x ** 2 + y ** 2 + x * y >= n:
                    break
                for z in range(y, int(math.sqrt(n))):
                    r = f(x, y, z)
                    if r > n:
                        break
                    if r == n:
                        if x == y == z:
                            cnt += 1
                        else:
                            cnt += 3
        print(cnt)


if __name__ == "__main__":
    N = int(input())
    main(N)

Submission status: Wrong Answer

Solution code:
a={}
for i in range(1,50):
    for j in range(1,50):
        for k in range(1,50):
            n=i*i+j*j+k*k+i*j+i*k+j*k

            if n not in a:
                a[n]=1
            else:
                a[n]+=1

t=int(input())
for i in range(1,t+1):
    if i in a:
        print(a[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
##a = int(stdin.readline().rstrip())
##b, c = [int(x) for x in stdin.readline().rstrip().split()]
##s = stdin.readline().rstrip()
##a = list(set(b))  重複を削除
##a = list(map(int,[int(x) for x in stdin.readline().rstrip().split()])) a[0, 1, 2, ...]
##a = [[0] * 2 for _ in range(n)]  a[0,0]
##v = [s[i: i+2] for i in range(0, len(s), 2)]
##  s="12345678" を v=["12","34","56","78"] にするイメージ
##s = "".join(list)リストを文字列に変換[""]は区切り文字
##a.sort(key=itemgetter(1))リストをソートできるよ(from operator import itemgetterが必要)
##sort_p = sorted(p) 昇順ソート

# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce
import numpy as np
import random
import bisect
import copy
# stdin = open("sample.txt")


MOD = 1000000007
INF = float('inf')
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]

def keta(kazu): # 入力されたintを桁ごとに分解，リストで出力
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

def gcd(*numbers): # 最小公倍数
    return reduce(math.gcd, numbers)

def combination(m,n): # mCn
    
    if n > m:
        return 'すまん'
    return math.factorial(m) // (math.factorial(m-n) * math.factorial(n))

def pow_k(x,n):  # (x**n)の計算の高速化
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2
    return K * x

def fact(n): # nの素因数分解の結果を辞書で出力 fuct(24) → {2: 3, 3: 1}
    arr = {}
    temp = n
    for i in range(2,int(n**0.5)+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt
    if temp != 1:
        arr[temp] = 1
    if arr == {}:
        arr[n] = 1
    return arr


    
def main():
    N = int(stdin.readline().rstrip())
    a = {i:0 for i in range(10000)}
    
    for x in range(1,98):
        for y in range(1,98):
            for z in range(1,98):
                n = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if n <= 10000:
                    a[n-1] += 1
    for i in range(N):
        print(a[i])
                    
main()

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0] * N
sqrt_N = (int(N**0.5 + 1))

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

[print(i) for i in ans]

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[0]*(10**4+1)
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            t=x*x+y*y+z*z+x*y+y*z+z*x
            if t<=10**4:
                if (x!=y) and y!=z:
                    l[t]+=6
                elif x==y and y==z:
                    l[t]+=1
                else:
                    l[t]+=3
for i in range(1,n):
    print(l[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [0] * 25000
for x in range(1, 50):
    for y in range(1, 50):
        for z in range(1, 50):
            n_ = x**2 + y**2 + z**2 + x*y + y*z + z*x
            
            l = len({x, y, z})
            if l == 1:
                tmp = 1
            elif l == 2:
                tmp = 3
            else:
                tmp = 6
            arr[n_-1] = tmp

print(*arr[:n], sep='\n')

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for i in range(n+1):
  cnt=0
  for x in range(1,101):
    if x**2>i:
      break
    for y in range(1,x+1):
      if x**2+y**2>i:
        break
      for z in range(1,y+1):
        if x**2+y**2+z**2+x*y+y*z+z*x==i:
          cnt+=3
  ans=cnt
  if i==6:
    ans=1
  print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement, permutations
from collections import defaultdict
N = int(input())

def calc(x: int, y: int, z: int) -> int:
    return x**2 + y**2 + z**2 + x*y + y*z + z*x

memo = defaultdict(int)
for x,y,z in combinations_with_replacement(range(1, 42), 3):
    memo[calc(x,y,z)] += len(set(permutations((x,y,z))))

for i in range(1, N+1):
    print(memo.get(i, 0))