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:
from collections import Counter
def main():
    n = int(input())
    ans = []
    for x in range(1, n):
        for y in range(1, n):
            for z in range(1, n):
                ans.append(x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x)
    counter = Counter(ans)
    for i in range(1, n):
        print(counter[i])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
n=10000
ansl=[0]*10001
for i in range(10000,10001):    
    c=0
    x=0
    y=0
    z=0
    rn=int(float(math.sqrt(n)))
    for x in range(1,rn+1):
        for y in range(1,rn+1):
            for z in range(1,rn+1):
                if x**2+y**2+z**2+x*y+y*z+z*x<=10000:
                    ansl[x**2+y**2+z**2+x*y+y*z+z*x]+=1
for i in range(10000):                
    print(ansl[i+1])

Submission status: Wrong Answer

Solution code:
N = int(input())

result = [0] * N
for x in range(1, 101):
    for y in range(1, x+1):
        for z in range(1, y+1):
            temp = pow(x+y, 2) + pow(y+z, 2) + pow(z+x, 2)
            n = temp // 2
            if n >= N:
                break
            if x != y and y != z and z != x:
                result[n-1] += 6
            elif x != y or y != z or z != x:
                result[n-1] += 3
            else:
                result[n-1] += 1

for r in result:
    print(r)

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt = 0
for i in range(1, N+1):
  for x in range(10):
    for y in range(10):
      for z in range(10):
        if (x+y)^2 + (y+z)^2 + (z+x)^2 == 2*i:
          cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ret = [0 for i in range(N)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            a = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if a < N:
                ret[a-1] += 1

for i in ret:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
for n in range(1,N+1):
    a=n//6+1

    saidai=int(a**0.5)+19
    answer=0
    for z in range(1,saidai+1):
        if 3+z**2+2*z>n:
            break
        for y in range(1,z+1):
            if y**2+z**2+1+y+z+y*z>n:
                break
            for x in range(1,y+1):
                if x**2+y**2+z**2+x*y+y*z+z*x==n:
                    if x==y==z:
                        answer+=1
                        break
                    elif x==y or y==z or z==x:
                        answer+=3
                        break
                    else:
                        answer+=6
                        break
    print(answer)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from pprint import pprint
from collections import deque, defaultdict
import itertools
import math
import sys

sys.setrecursionlimit(10 ** 6)
INF = float('inf')


N = int(input())


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


# for x in range(1, 15):
#     for y in range(1, 15):
#         for z in range(1, 15):
#             print(g(x, y, z))

for n in range(1, N+1):
    num_dict = {}
    res = 0
    for x in range(1, 20):
        for y in range(1, 20):
            for z in range(1, 20):
                num = g(x, y, z)
                if num > n:
                    break
                if num == n:
                    # print(f'{x}+{y}+{z}={num}')
                    if (x, y, z) in num_dict:
                        continue
                    # print('doesnt exist')
                    num_dict[(x, y, z)] = 1
                    res += 1
    print(res)

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

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

def Main():
    n = I()
    c = [0]*n
    fa = True
    for i in range(1,n+1):
        for j in range(1,n+1):
            tmp = f(i,i,j)
            if n<tmp:
                if j==1:
                    fa = False
                    break
                else:   
                    break
            if j==i:
                d = 1
            else:
                d = 3
            c[tmp-1] += d
        if not fa:
            break

    for i in c:
        print(i)
    return

if __name__=='__main__':
    Main()

Submission status: Wrong Answer

Solution code:
# from pprint import pprint
# import math
# import collections
from numba import jit

N = int(input())


# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))

@jit(cache=True)
def calc(x, y, z):
    return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


p = []
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            #         p.append((x, y, z))
            p.append(calc(x, y, z))

# print(p)

for i in range(1, N):
    if i == 6:
        print(1)
    elif i in p:
        print(3)
    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, 31):
        for y in range(1, 31):
            for z in range(1, 31):
                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:
from collections import Counter
from itertools import combinations_with_replacement
N = int(input())
L = [i for i in range(1, 50)]
C = Counter()
for i in range(1, N+1):
    C[i] = 0
for c in combinations_with_replacement(L, 3):
    x = c[0]
    y = c[1]
    z = c[2]
    tmp = x**2+y**2+z**2+x*y+y*z+z*x
    if tmp <= N:
        if len(set(c)) == 2:
            C[tmp] += 3
        elif len(set(c)) == 3:
            C[tmp] += 6
        else:
            C[tmp] += 1

for i in range(1, N+1):
    if C[i]:
        print(C[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

for i in range(1,N+1):
  ans = 0
  for x in range(1,math.ceil(math.sqrt(i/3))):
    # if x**2 + x**2 + x**2 + x*x + x*x + x*x > i:
    #   break
    for y in range(x,math.ceil(math.sqrt(i/2))):
      # if x**2 + y**2 + y**2 + x*y + y*y + y*x > i:
      #   break
      for z in range(y,math.ceil(math.sqrt(i))):
        # print(x,y,z)
        if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
          if x == y == z:
            ans += 1
          elif x == y | x == z | y == z:
            ans += 2
          else:
            ans += 3
          break
        elif x**2 + y**2 + z**2 + x*y + y*z + z*x > i:
          break
      
  print(ans)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())
sqN = int(math.sqrt(N))+1

sq=list()
for i in range(1,N):
    sq.append(i*i)

def isSquare(n):
    if n in sq:
        return True
    else:
        return False

ans=list()
for i in range(min(N,6)):
    ans.append(0)

if N>5:
    for m in range(6,N+1):
        cnt = 0
        for x in range(1,sqN):
            for y in range(1,sqN):
                b = x+y
                D = -3*(x*x+y*y)-2*x*y+4*m

                print(m,x,y,D,isSquare(D))
                if D > 0 and isSquare(D):
                    sqD=sq.index(D)+1
                    if (sqD-b) > 0 and (sqD-b) % 2 == 0:
                        # z= (sqD-b)//2
                        # print(x,y,z)
                        # print(x*x+y*y+z*z+x*y+y*z-m)
                        cnt+=1
                if D < 0:
                    break
        ans.append(cnt)

for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
#1≤x,y,z
#x2+y2+z2+xy+yz+zx=n

N = int(input())

for i in range(N):
    count = 0
    for x in range(N):
        for y in range(N):
            for z in range(N):
                f = x ** 2 + y ** 2 + z ** 2 + (x * y) + (y * z) + (z * x)
                if x == 0 or y == 0 or z == 0:
                    continue
                elif f == i:
                    count += 1
                elif f > i:
                    continue
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=int(N**(0.353))
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:
import sys
from itertools import product, combinations_with_replacement
import math
input = sys.stdin.readline
#N, K = (int(i) for i in input().split())
#B = [int(x) for x in input().split()]
#A = [[int(i) for i in input().split()] for i in range(N)]
N = int(input())
d = {}

combs = list(combinations_with_replacement(range(1, int(math.sqrt(10001))), 3))
for c in combs:
    x, y, z = c
    calc = x**2 + y**2 + z**2 +x*y +z*y + x*z
    if  x == y and y == z:
        d[calc] = 1
    elif x== y or x == z or y == z:
        d[calc] = 3
    else:
        d[calc] = 6


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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from pprint import pprint
from collections import deque, defaultdict
import itertools
import math
import sys

sys.setrecursionlimit(10 ** 6)
INF = float('inf')


N = int(input())


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


# for x in range(1, 15):
#     for y in range(1, 15):
#         for z in range(1, 15):
#             print(g(x, y, z))

for n in range(1, N+1):
    num_dict = {}
    res = 0
    for x in range(1, 15):
        for y in range(1, 15):
            for z in range(1, 15):
                num = g(x, y, z)
                if num > n:
                    break
                if num == n:
                    # print(f'{x}+{y}+{z}={num}')
                    if (x, y, z) in num_dict:
                        continue
                    # print('doesnt exist')
                    num_dict[(x, y, z)] = 1
                    res += 1
    print(res)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
counts = [0]*N
for x in range(N):
    if x**2>(int(math.sqrt(N))+1):
        break
    for y in range(N):
        if y**2 > (int(math.sqrt(N))+1):
            break
        for z in range(N):
            if z**2 > (int(math.sqrt(N))+1):
                break
            i = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
            if i<=N:
                counts[i-1]+=1
for k in counts:
    print(k)

Submission status: Wrong Answer

Solution code:
### Problem C
import math

N = int(input())
rt = []

for i in range(1,N+1):
    if i <= 3000:
        rt.append(int(math.sqrt(i)))
    elif i > 3000:
        rt.append(int(math.sqrt(i)/1.4))

for x in range(0,N):
    cnt = 0
    for i in range(1,rt[x]):
        for j in range(1,rt[x]):
            for k in range(1,rt[x]):
                if (i + j + k)**2 == x + (i*j + j*k + k*i):
                    cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[0]*10**7
s=int(n**0.5)+10
for x in range(1,s):
    for y in range(1,s-x):
        for z in range(1,s-x-y):
            l[x*x+y*y+z*z+x*y+y*z+z*x-1]+=1
for i in range(n):
    print(l[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
x,y,z = 1,1,1
for i in range(1,n+1):
    flag = True
    for j in range(0,5):
        if (x+j)**2+(y+j)**2+(z+j)**2+(x+j)*(y+j)+(y+j)*(z+j)+(z+j)*(x+j) == i:
            print(1)
            x += j
            y += j
            z += j
            flag = False
            break
        elif (x+j)**2+y**2+z**2+(x+j)*y+y*z+z*(x+j) == i:
            print(3)
            flag = False
            break
        elif (x+j)**2+(y+j)**2+z**2+(x+j)*(y+j)+(y+j)*z+z*(x+j) == i:
            print(3)
            flag = False
            break
    if flag:
        print(0)

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, num_m+1):
    for y in range(1, num_m+1-x):
        if (x+y)**2-x*y-N<=0:
            continue
        for z in range(1, num_m+1-x-y):
            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 sys
import math
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()

    ans = {i: 0 for i in range(1, 10001)}
    for i in range(3, 100):
        for j in range(1, i):
            for k in range(1, i):
                l = i - j - k
                if l <= 0:
                    break
                else:
                    v = j ** 2 + k ** 2 + l ** 2 + j * k + k * l + j * l
                    ans[v] += 1
    for i in range(1, N + 1):
        print(ans[i])


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
def g(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
ans = []
def f(n):
    sum = 0
    rn = int(math.sqrt(n))
    for i in range(1,rn):
        for j in range(1,rn):
            for k in range(1,rn):
                #print(i,j,k)
                if g(i,j,k) == n:
                    #print('find')
                    if (i == j and j==k):
                        sum += 1
                        ans.append(str(sum))
                        return
                    elif (i == j and j != k) or (i == k and j != k) or (i != j and j == k):
                        sum += 3
                        ans.append(str(sum))
                        return
                    elif i != j and i != k and j != k:
                        sum += 6
                        ans.append(str(sum))
                        return
    ans.append(str(0))
                

    

for i in range(n+1):
    f(i)

print('\n'.join(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [0] * n
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:
                break
            
            l = len({x, y, z})
            if l == 1:
                tmp = 1
            elif l == 2:
                tmp = 3
            else:
                tmp = 6
            arr[n_-1] = tmp

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

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=int(N**(0.352))
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())
cnt = 0
for i in range(1, N+1):
  for x in range(100):
    for y in range(100):
      for z in range(100):
        if (x+y)^2 + (y+z)^2 + (z+x)^2 == 2*i:
          cnt += 1
print(cnt)

Submission status: Wrong Answer

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):
            num=x*y+y*z+z*x+x*x+y*y+z*z
            if num>N:
                break
            if x==y and y==z:
                ans[num]=1
            elif x==y or y==z or x==z:
                ans[num]=3
            else:
                ans[num]=6
for i in range(N):
    print(ans[i+1])

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

for i in range(1,N+1):
  ans = 0
  for x in range(1,math.ceil(math.sqrt(i/3))):
    if x**2 + x**2 + x**2 + x*x + x*x + x*x > i:
      break
    for y in range(x,math.ceil(math.sqrt(i/2))):
      if x**2 + y**2 + y**2 + x*y + y*y + y*x > i:
        break
      for z in range(y,math.ceil(math.sqrt(i))):
        if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
          if x == y == z:
            ans += 1
          elif x == y | x == z | y == z:
            ans += 2
          else:
            ans += 3
          break
        elif x**2 + y**2 + z**2 + x*y + y*z + z*x > i:
          break
      
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=int(N**(0.3500000))
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:
a = int(input())
x = 1
y = 1
z = 1
listN = []
while x<=99:
    y =1
    z =1
    while y<=99:
        z = 1
        while z<=99:
            listN.append(x**2+y**2+z**2+x*y+y*z+z*x)
            z = z+1
        y = y+1
    x = x+1
n = 1
while n<=a:
    print(listN.count(n), n)
    n = n+1

Submission status: Wrong Answer

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

for i in range(9,n+1):
    c = 0

    if int(math.sqrt(i)) > 1:
        for x in range(1,int(math.sqrt(i))):
            for y in range(1,int(math.sqrt(i))):
                if -3*(x**2) -3*(y**2) - 2*x*y + 4*i > 0:
                    z = (-1*(x+y) + math.sqrt(-3*(x**2) -3*(y**2) - 2*x*y + 4*i)) / 2
                    if z.is_integer() and z > 0:
                        c += 1

    print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n + 1):
    cnt = 0
    perf = False
    one = False
    diff = False
    for x in range(1, 42):
        for y in range(x, 42):
            for z in range(y, 42):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == i:
                    cnt += 1
                    if (x == y and y != z) or (x == z and x != y) or (y == z and x != y):
                        one = True
                    elif x != y and y != z and z != x:
                        diff = True
                    else:
                        perf = True
    if perf:
        print(cnt)
        perf = False
        one = False
        diff = False
    elif one:
        print(cnt * 3)
        perf = False
        one = False
        diff = False
    else:
        print(cnt * 6)
        perf = False
        one = False
        diff = False

Submission status: Wrong Answer

Solution code:
import sys

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

def count(x, y, z):
    uniq_num = len(set([x, y, z]))
    if uniq_num == 3:
        return 6  # 3!
    elif uniq_num == 2:
        return 3  # 3C1
    else:
        return 1

def show_result(ans):
    for n,fn in enumerate(ans[1:]):
        print(fn)

N = int(input())

ans = [0]*(N+1)
x = y = z = 1
while x <= N-3 and left(x, y, z) <= N:
    while y <= N-3 and left(x, y, z) <= N:
        while z <= N-3 and left(x, y, z) <= N:
            l = left(x, y, z)
            ans[l] = count(x, y, z)
            z += 1
        y += 1
        z = y
    x += 1
    y = z = x
show_result(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N=int(input())
s= [0 for i in range(10002)]
for x in range(1,100):
    for y in range(1,100):
        if x*x + y*y>1000:break
        for z in range(1,100):
            a = x*x + y*y + z*z +x*y + y*z + z*x
            if a >10000:break
            s[a] +=1

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

cnts = [0] * (n + 1)
for s in range(int(math.sqrt(n)) + 10):
  for x in range(1, s + 1):
    for y in range(1, s + 1):
      z = s - x - y
      if 1 <= z:
        f = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
        if 1 <= f <= n:
          cnts[f] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())

rng = [0] * (n+1)

for i in range(1,32):
    for j in range(1,32):
        for k in range(1,32):
            buf = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if buf > n:
                break
            else:
                rng[buf] += 1

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

Submission status: Wrong Answer

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

for p in range(1, n+1):
  right=math.floor(p**(1/3))+2
  cnt=0
  for i in range(1, right):
    for j in range(1, i+1):
      for k in range(1, j+1):
        if (i+j+k)**2-i*j-j*k-k*i==p:
          if i==j and j==k:
            cnt+=1
          elif i==j and j!=k:
            cnt+=3
          elif j==k and k!=i:
            cnt+=3
          elif k==i and i!=j:
            cnt+=3
          elif i!=j and j!=k and k!=i:
            cnt+=6
  print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from itertools import product

N = int(input())

cnt = [0]*100000000

for x in range(1,81):
    for y in range(1,81):
        for z in range(1,81):
            if x==y and y==z:
                continue
            else:
                cnt[x**2 + y**2 + z**2 + x*y + y*z + z*x -1] += 1

##x==y==zの時
for i in range(1,81):
    cnt[i**2 + i**2 + i**2 + i*i + i*i + i*i -1] += 1

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

Submission status: Wrong Answer

Solution code:
n= int(input())
ans = [0 for i in range(n)]
for x in range(1, n+1):
    if x ** 2 >= n:
        break
    for y in range(x, n+1):
        if x**2 + y**2 >= n:
            break
        for z in range(y, n+1):
            val = (x+y+z)**2 - x*y - y*z - z*x
            if val > n:
                break
            if x == y == z:
                ans[val-1] += 1
            elif x == y or y == z:
                ans[val-1] += 3
            else:
                ans[val-1] += 6
                print(x,y,z)
                
for i in ans:
    print(i)

Submission status: Wrong Answer

Solution code:
from itertools import 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
        else:
            ans[i] += 3

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import itertools
n = int(input())
max = math.floor(n**(1/2))
L = [0 for i in range(n)]
l = []
for i in range(1, max+1):
    l.append(i)


for v in itertools.combinations_with_replacement(l, 3):
    x = v[0]
    y = v[1]
    z = v[2]
    t = x**2 + y**2 + z**2 + x*y + y*z + z*x
    if t <= n:
        if x == y and y == z:
            L[t-1] = 1
        elif x == y or y == z:
            L[t-1] = 3
        else:
            L[t-1] = 6
for j in L:
    print(j)

Submission status: Wrong Answer

Solution code:
a, b = 1, 1
N = int(input())
test = (a ** 2) * 3 + b ** 2 + a * b * 2
hoge = 2
for i in range(1, N + 1):
    x = 0
    while True:

        if test == i:
            if a == b:
                x += 1
            else:
                x += 3
            if b - 1 <= 0:
                hoge += 1
                b = hoge - 1
                a = 1
            else:
                b -= 1
                a += 1
            test = (a ** 2) * 3 + b ** 2 + a * b * 2
        else:
            print(x)
            break

Submission status: Wrong Answer

Solution code:
N = int(input())
result = [0 for x in range(1000000)]

l = 0
p=0
for i in range(1,100):
    if p>10000:
        break
    for j in range(1,100):
        if p>10000:
            break
        for k in range(1,100):
            p = int(i*i+i*j+j*j+j*k+k*k+k*i )
            if p>10000:
                break
            result[l] = p
            l+=1
for i in range(1,N+1):
    print(result.count(i))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N=int(input())
s= [0 for i in range(10002)]
for x in range(1,100):
    for y in range(1,100):
        if x*x + y*y>1000:break
        for z in range(1,100):
            a = x*x + y*y + z*z +x*y + y*z + z*x
            if a >10000:break
            s[a] +=1

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

def xyzTriplets(N):
    store = {}
    upTo = math.sqrt(N)
    for x in range(1, int(upTo) + 1):
        for y in range(1, int(upTo) + 1):
            for z in range(1, int(upTo) + 1):
                res = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if (res not in store):
                    store[res] = 1
                else:
                    store[res] += 1
    for i in range(N):
        if (i in store):
            print(store[i])
        else:
            print(0)



xyzTriplets(N)

Submission status: Wrong Answer

Solution code:
import sys
from itertools import product, combinations_with_replacement
import math
input = sys.stdin.readline
#N, K = (int(i) for i in input().split())
#B = [int(x) for x in input().split()]
#A = [[int(i) for i in input().split()] for i in range(N)]
N = int(input())
d = {}

combs = list(combinations_with_replacement(range(1, int(math.sqrt(20000))), 3))
for c in combs:
    x, y, z = c
    calc = x**2 + y**2 + z**2 +x*y +z*y + x*z
    if  x == y and y == z:
        d[calc] = 1
    elif x== y or x == z or y == z:
        d[calc] = 3
    else:
        d[calc] = 6


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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
l = []
for i in range(2,143):
    l.append(i**2)
dic = defaultdict(int)
for i in range(141):
    for j in range(i, 141):
        for k in range(j, 141):
            
            if (l[i]+l[j]+l[k])%2==0 and 2+l[k]<=l[i]+l[j]:
                
                if i==j and j==k:
                    dic[l[i]+l[j]+l[k]]+=1
                elif i==j or j==k or i==k:
                    dic[l[i]+l[j]+l[k]]+=3
                else:
                    dic[l[i]+l[j]+l[k]]+=6
for i in range(1, n+1):
    print(dic[2*i])

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=[0]*(10**5)
for x in range(1,N+1):
    if x**2>N:
        break
    for y in range(x,N+1):
        if x**2+y**2>N:
            break
        for z in range(y,N+1):
            if x**2+y**2+z**2>N:
                break
            if x**2+y**2+z**2+x*y+y*z+z*x<=N+1:
                ans[x**2+y**2+z**2+x*y+y*z+z*x-1]=3
if N>=6:
    ans[5]=1
for i in range(N):
    print(ans[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:
                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 i in range(1,N+1):
    if i in ANS.keys():
        print(ANS[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=int(N**(0.35))
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())
for i in range(1, n + 1):
    cnt = 0
    perf = False
    one = False
    diff = False
    for x in range(1, 41):
        for y in range(x, 41):
            for z in range(y, 41):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == i:
                    cnt += 1
                    if (x == y and y != z) or (x == z and x != y) or (y == z and x != y):
                        one = True
                    elif x != y and y != z and z != x:
                        diff = True
                    else:
                        perf = True
    if perf:
        print(cnt)
        perf = False
        one = False
        diff = False
    elif one:
        print(cnt * 3)
        perf = False
        one = False
        diff = False
    else:
        print(cnt * 6)
        perf = False
        one = False
        diff = False

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [[] for _ in range(N)]
for x in range(1, 101):
    for y in range(x, 101):
        for z in range(y, 101):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if n > N:
                break
            ans[n - 1].append((x, y, z))
print(ans)
count = 0
# 複数パターンを考慮しているか？
for an in ans:
    if an == []:
        print(0)
    else:
        a = an[0]
        if a[0] == a[1] and a[1] == a[2]:
            print(1)
        elif not a[0] == a[1] and not a[1] == a[2] and not a[2] == a[0]:
            print(6)
        else:
            print(3)