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:
if __name__ == "__main__":
    
    n = int(input())

    s = 1
    if n > 6:
        s = -1 + int((n-2)**0.5)

    for o in range(s, n+1):
        for x in range(1, 100):
            isFound = False
            isOver = False
            for y in range(1, x+1):
                for z in range(1, y+1):
                    m = x**2+y**2+z**2+x*y+y*z+z*x
                    if m == o:
                        isFound = True
                        if x==y and y==z: print(1)
                        elif x==y or y==z or z==x: print(3)
                        else: print(6)
                        break
                    elif m > o:
                        isOver = True
                        break
                if isFound or isOver: break
            if isFound: break
        if not isFound: print(0)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
ans_list = []
for x in range(1,100):
  for y in range(1,100):
    for z in range(1,100):
      hoge = x*x+y*y+z*z+x*y+y*z+z*x
      if hoge < 10000:
        ans_list.append(hoge)

counter = collections.Counter(ans_list)
for i in range(n):
  print(counter[i])

Submission status: Wrong Answer

Solution code:
import sys, math
import io, os
#data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
#from bisect import bisect_left as bl, bisect_right as br, insort
#from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
#from itertools import permutations,combinations
def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(int, data().split()))
def outl(var) : sys.stdout.write('\n'.join(map(str, var))+'\n')
def out(var) : sys.stdout.write(str(var)+'\n')
#from decimal import Decimal
#from fractions import Fraction
#sys.setrecursionlimit(100000)
#INF = float('inf')
mod = int(1e9)+7

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

n=int(data())
for l in range(1,n):
    cnt=0
    for i in range(1,int(l**0.5)):
        for j in range(1,int(l**0.5)):
            if cal(i,j,1)>l:
                break
            for k in range(1,int(l**0.5)):
                a= cal(i,j,k)
                if a==l:
                    cnt+=1
                elif a>l:
                    break
    out(cnt)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
import math

def run():
    N = int(input())
    for n in range(1, N+1):
        ret = 0
        val = int(math.log2(2 * n))
        for X in range(-val, val+1):
            for Y in range(-val, val+1):
                tmp1 = 2 * n - X ** 2 - Y ** 2
                if tmp1 >= 0 and math.sqrt(tmp1) == int(math.sqrt(tmp1)):
                    Z_ = int(math.sqrt(tmp1))
                    if Z_ != 0:
                        for k in [-1, 1]:
                            Z = Z_ * k
                            if not (X + Y + Z) % 2:
                                xyz = (X + Y + Z) // 2
                                x = xyz - Y
                                y = xyz - Z
                                z = xyz - X
                                if x >= 1 and y >= 1 and z >= 1:
                                    ret += 1
                                    #print(x, y,z)


        print(ret)



if __name__ == "__main__":
    run()

Submission status: Wrong Answer

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

def judge(n, x=1, y=1, z=1, l=[]):
    n_odd = n % 2 == 0
    num = 0
    x_th = math.ceil(math.sqrt(n) / 3) + 1
    for x_i in range(1, x_th+1):
        for y_i in range(x_i, x_th+1):
            y_th = n - x_i**2 + y_i**2 + x_i*y_i
            if y_th < 0:
                break
            for z_i in range(y_i, x_th+1):
                x_odd = x_i % 2 == 0
                y_odd = y_i % 2 == 0
                z_odd = z_i % 2 == 0
                num_odd = x_odd + y_odd + z_odd
                if n_odd and (num_odd == 1 or num_odd == 2):
                    continue
                result = x_i**2 + y_i**2 + z_i**2 + x_i*y_i + y_i*z_i + z_i*x_i
                if result > n:
                    break
                elif result == n:
                    #if x_i != y_i != z_i:
                    #    num += 6
                    #    break
                    if x_i == y_i != z_i or x_i != y_i == z_i:
                        num += 3
                        break
                    elif x_i == y_i == z_i:
                        num += 1
                        break
    return num

#fn = judge(18, l=[])
#print(fn)
for i in range(1, n+1):
    fn = judge(i, l=[])
    print(fn)

Submission status: Wrong Answer

Solution code:
# C - XYZ Triplets
N = int(input())
ans = 0
for l in range(N):
    ans = 0
    for i in range(100):
        for j in range(i,100):
            # a = (i+1)+(j+1)
            # b = (i+1)*(j+1)
            # if (i + 1) ** 2 + (j + 1) ** 2 + (k + 1) ** 2 + (i + 1) * (j + 1) + (j + 1) * (k + 1) + (k + 1) * (
            #         i + 1) == l + 1:
            for k in range(j,100):
                if (i + 1) ** 2 + (j + 1) ** 2 + (k + 1) ** 2 + (i + 1) * (j + 1) + (j + 1) * (k + 1) + (k + 1) * (
                        i + 1) == l + 1:
                    if i == j == k:
                        ans = 1
                        break

                    elif (i == j and j != k) or (k == j and i != k):
                        ans = 3
                        break
                    else:
                        ans = 6
                        break
                break
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

    rn = math.ceil(math.sqrt(N))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N/2))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

    rn = math.ceil(math.sqrt(N))

    for x in range(1,rn):
        for y in range(1,rn):
            for z in range(1,rn):
                k = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if k <= N:
                    ans[k] += 1
    
    for i in range(len(ans)):
        print(ans[i])
    
main()

Submission status: Wrong Answer

Solution code:
import collections

ans_list = []

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            tmp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if tmp <= 10000:
                ans_list.append(tmp)

ans_list = sorted(ans_list)
print(ans_list)

N = int(input())

c = collections.Counter(ans_list)

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

Submission status: Wrong Answer

Solution code:
import numpy as np
#import functools
#import operator
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with
#from itertools import permutations as perm
#import collections as C #most_common
#import math
#import sympy

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

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


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

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(1,n+1):
    a=0
    ii=int((i**0.5)+1)
    x=1
    while(x<ii):
        y=x
        while(x+y<ii):
            z=ii-x-y
            if((x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)==i):
                if(x==y==z):
                    a+=1
                elif(x<y<=z or x<=y<z):
                    a+=3
                elif(x<y<z):
                    a+=6
            y+=1
        x+=1
    print(a)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
ans = np.zeros((N+1))
x = 1
y = 1
z = 1
while True:
  f = (x+y)**2+(y+z)**2+(z+x)**2
  if((f%2==0) and (f <= 2*N) and (ans[int(f/2)] == 0)):
    if((x==y)and(y==z)):
      ans[int(f/2)] = 1
    elif(((x==y)and(y!=z))or((x==z)and(z!=y))or((y==z)and(z!=x))):
      ans[int(f/2)] = 3
    elif((x!=y)and(y!=z)and(z!=x)):
      ans[int(f/2)] = 6
  if(f>2*N):
    break
  z += 1

for i in range(1,z-1):
  for j in range(1,z-1):
    for l in range(1,z-1):
      f = (i+j)**2+(j+l)**2+(l+i)**2
      if((f%2==0) and (f <= 2*N) and (ans[int(f/2)] == 0)):
        if((i==j)and(j==l)):
          ans[int(f/2)] = 1
        elif(((i==j)and(j!=l))or((i==l)and(l!=j))or((j==l)and(l!=i))):
          ans[int(f/2)] = 3
        elif((i!=j)and(j!=l)and(l!=i)):
          ans[int(f/2)] = 6

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = []
for i in range(1,46):
  for j in range(1,46):
    for k in range(1,46):
      A.append(i**2+j**2+k**2+i*j+i*k+j*k)
A = sorted(A)
B = [0]*100000
for i in range(10000):
  if A[i] < 10000:
    B[A[i]] += 1
C = B[1:N+1]
[print(i) for i in C]

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
import math

def run():
    N = int(input())
    for n in range(1, N+1):
        ret = 0
        val = int(math.log2(2 * n))
        for X in range(-val, val+1):
            for Y in range(-val, val+1):
                tmp1 = 2 * n - X ** 2 - Y ** 2
                if tmp1 >= 0 and math.sqrt(tmp1) == int(math.sqrt(tmp1)):
                    Z_ = int(math.sqrt(tmp1))
                    if Z_ != 0:
                        for k in [-1, 1]:
                            Z = Z_ * k
                            if not (X + Y + Z) % 2:
                                xyz = (X + Y + Z) // 2
                                x = xyz - Y
                                y = xyz - Z
                                z = xyz - X
                                if x >= 1 and y >= 1 and z >= 1:
                                    ret += 1
                                    #print(x, y,z)
                    else:
                        if not (X + Y + Z_) % 2:
                            xyz = (X + Y + Z_) // 2
                            x = xyz - Y
                            y = xyz - Z_
                            z = xyz - X
                            if x >= 1 and y >= 1 and z >= 1:
                                ret += 1

        print(ret)



if __name__ == "__main__":
    run()

Submission status: Wrong Answer

Solution code:
n = int(input())

lis = [0] * (n+1)

s  = int(n**0.5)

for i in range(1, s):
    for j in range(1, s):
        for k in range(1, s):
            t = i**2 + j**2 + k**2 + i*j + j*k + i*k
            tmp = [i,j,k]
            
            if t <= n:
                lis[t] += 1

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

Submission status: Wrong Answer

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

def judge(n, x=1, y=1, z=1, l=[]):
    n_odd = n % 2 == 0
    num = 0
    x_th = math.ceil(math.sqrt(n) / 3) + 1
    #print('x_th: ', x_th+1)
    for x_i in range(1, x_th+1):
        #print('x_i: ', x_i)
        for y_i in range(x_i, x_th+1):
            y_th = n - x_i**2 + y_i**2 + x_i*y_i
            #print('y_i: ', y_i)
            #print('y_th: ', y_th)
            if y_th < 0:
                break
            for z_i in range(y_i, x_th+1):
                x_odd = x_i % 2 == 0
                y_odd = y_i % 2 == 0
                z_odd = z_i % 2 == 0
                num_odd = x_odd + y_odd + z_odd
                if n_odd and (num_odd == 1 or num_odd == 2):
                    continue
                #print('z_i: ', z_i)
                result = x_i**2 + y_i**2 + z_i**2 + x_i*y_i + y_i*z_i + z_i*x_i
                #print('result: ', result)
                if result > n:
                    break
                elif result == n:
                    if x_i != y_i != z_i:
                        num += 6
                        break
                    elif x_i == y_i != z_i or x_i != y_i == z_i:
                        num += 3
                        break
                    elif x_i == y_i == z_i:
                        num += 1
                        break
                    #print('num: ', num)
    return num

#fn = judge(18, l=[])
#print(fn)
for i in range(1, n+1):
    fn = judge(i, l=[])
    print(fn)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,int(math.sqrt(N/3)+2)):
    for j in range(1,int(math.sqrt(N/3)+2)):
        for k in range(1,int(math.sqrt(N/3)+2)):
            if (i+j+k)**2-(i*j+j*k+k*i) <= N:
                ans[(i+j+k)**2-(i*j+j*k+k*i)-1] += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
y=[0 for _ in range(10**4)]
for j in range(1,41):
   for k in range(1,58):
      for u in range(1,101):
         a=j*j+k*k+u*u+j*k+k*u+u*j
         if a <= 10**4:
            if j==k and k==u:
               y[a-1]=1
            elif j==k or k==u:
               y[a-1]=3
            else:
               y[a-1]=6
for o in range(n):
   print(y[o])

Submission status: Wrong Answer

Solution code:
n=int(input())

ans=[0]*(n+1)

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

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

Submission status: Wrong Answer

Solution code:
import itertools
n = int(input())
ans = [0] * n
for x,y,z in itertools.combinations_with_replacement(list(range(1,10**2+1)),3):
    a = x**2 + y**2 + z**2 + x*y + y*z + z*x
    if a > n: continue
    if x==y==z: b = 1
    elif x==y or x==z or y==z: b = 3
    else: b = 6
    ans[a-1] = b
for i in ans: print(i)

Submission status: Wrong Answer

Solution code:
n=int(input())

ans=[0]*10001

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())

ans=[0]*10001

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

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
ans=n*[0]
count=1
while count<=6 and count<n:
    ans[count-1]=0
    count+=1
    if count==6:
        ans[count-1]=1
        count+=1

root=4
found=False
while not found:
    thing=math.ceil(int(root/3))
    while thing>0:
        s=root-thing
        a=int(s/2)
        b=s-a
        firstindex=root**2-(thing*a+a*b+thing*b)
        if firstindex>n:
            found=True
            break
        while a>=1 and b>=1:
            ways=len(set([thing,a,b]))
            index=root**2-(thing*a+a*b+thing*b)
            if index<=n:
                if ways==1:
                    ans[index-1]+=1    
                elif ways==2:
                    ans[index-1]+=3
                else:
                    ans[index-1]+=6
                if a<b:
                    a-=1
                    b+=1
                else:
                    a+=1
                    b-=1
            else:
                break
        thing-=1
    root+=1

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

Submission status: Wrong Answer

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


N = int(input())
count = [0] * (N + 1)
for x in range(1, 45):
    for y in range(1, 45):
        for z in range(1, 45):
            cur = g(x, y, z)
            if cur <= N:
                count[cur] += 1
for i in range(1, N + 1):
    print(count[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
fn = [0] * (n+1)
def f(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x 

for x in range(1, 35):
    for y in range(1, 35):
        for z in range(1, 35):
            idx = f(x, y, z)
            if idx <= n:
                fn[idx] += 1
for i in range(1, n+1):
    print(fn[i])

Submission status: Wrong Answer

Solution code:
n=int(input())

ans=[0]*10001

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
list_ = [0]*1000000
for i in range(100):
   for j in range(100):
       for k in range(100):
           list_[i**2 + j**2 + k**2+i*j+j*k+k*i - 1] += 1
for i in range(n):
    print(list_[i])

Submission status: Wrong Answer

Solution code:
n = int(input())

lis = [0] * (10000+1)

s  = int(n**0.5)

for i in range(1, s):
    for j in range(1, s):
        for k in range(1, s):
            t = i**2 + j**2 + k**2 + i*j + j*k + i*k
            tmp = [i,j,k]
            
            if t <= 10001:
                if len(set(tmp)) == 1:
                    lis[t-1] = 1
                elif len(set(tmp)) == 2:
                    lis[t-1] = 3
                else:
                    lis[t-1] = 6

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0 for _ in range(N+1)]
for X in range(2,201):
  for Y in range(X, 201):
    for Z in range(Y , 201):
      f = (X**2+Y**2+Z**2)
      if f > 2*N:
        break
      if (X+Y+Z)%2 != 0:
        continue
      S = (X+Y+Z)//2
      x = S - X
      y = S - Y
      z = S - Z
      if x==0 or y==0 or z==0:
        continue
      if x==y and y==z:
        
        ans[f//2] += 1
      elif x==y or y==z or z==x:
        
        ans[f//2] += 3
      else:
        
        ans[f//2] += 6
for a in ans[1:]:
  print(a)

Submission status: Wrong Answer

Solution code:
import copy

def main():
    N = int(input())
    x = 1
    y = 1
    z = 1
    i = 0
    while i < N:
        x = 1
        y = 1
        z = 1
        xd = 1
        yd = 1
        zd = 1
        check = copy.copy(i) + 1
        for j in range(check):
            if (x*x) + (y*y) + (z*z) + (x*y) + (y*z) + (z*x) < check:
                if j % 3 == 1:
                    x = x + 1
                elif j % 3 == 2:
                    y = y + 1
                elif j % 3 == 0:
                    z = z + 1
            elif (xd*xd) + (yd*yd) + (zd*zd) + (xd*yd) + (yd*zd) + (zd*xd) < check:
                if check % 3 == 1:
                    xd = xd + 1
                elif check % 3 == 2:
                    yd = yd + 1
                elif check % 3 == 0:
                    zd = zd + 1
                continue
            elif (x*x) + (y*y) + (z*z) + (x*y) + (y*z) + (z*x) == check:
                if x == y == z:
                    print(1)
                    break
                elif (x == y or y == z or z == x) or (x != y != z):
                    print(3)
                    break
            elif (xd*xd) + (yd*yd) + (zd*zd) + (xd*yd) + (yd*zd) + (zd*xd) == check:
                if xd == yd == zd:
                    print(1)
                    break
                elif (xd == yd or yd == zd or zd == xd) or (xd != yd != zd):
                    print(3)
                    break
            elif (x*x) + (y*y) + (z*z) + (x*y) + (y*z) + (z*x) > check and (xd*xd) + (yd*yd) + (zd*zd) + (xd*yd) + (yd*zd) + (zd*xd) > check:
                print(0)
                break
        i = i + 1

main()

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

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,i):
        if x ** 2 + x > i:
            print(x)
            break
        for y in range(x, i):
            if x ** 2 + x * y + y ** 2 > i:
                break
            res = -x-y
            d = math.sqrt(-3*(x ** 2) - 2*(x*y) - 3*(y**2) + 4*i)
            if (((res - d)/2).is_integer() or ((res + d)/2).is_integer()) and (res+d > 0 or res-d > 0):
                count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
fn = [0] * (10**5)
def f(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x 

for x in range(1, 35):
    for y in range(1, 35):
        for z in range(1, 35):
            idx = f(x, y, z)
            if idx <= n:
                fn[idx] += 1
for i in range(1, n+1):
    print(fn[i])

Submission status: Wrong Answer

Solution code:
N = int(input())

numbers = []
for i in range(1, 100):
    numbers.append(i)

result = []
for i in range(len(numbers)):
  for j in range(i, len(numbers)):
    for k in range(j, len(numbers)):
      result.append([numbers[i], numbers[j], numbers[k]])

ns = {}
for i in range(10000):
    ns[i+1] = 0

for i in result:
    count = 3
    if i[0] == i[1]:
        count -= 1
    if i[0] == i[2]:
        count -= 1
    if i[1] == i[2]:
        count -= 1

    junretsu = 0
    if count == 3:
        junretsu = 6
    elif count == 2:
        junretsu = 3
    else:
        junretsu = 1

    ns[i[0]**2 + i[1]**2 + i[2]**2 + i[0]*i[1] + i[1]*i[2] + i[2]*i[0]] = junretsu

for i in range(N):
    print(ns.get(i + 1))

Submission status: Wrong Answer

Solution code:
import math

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

    end = math.ceil(4*math.sqrt(N))

    for i in range(3,end+1):
        sn = i
        x = 1
        y = 1
        z = sn - 2
        zt = z
        if(cal(x,y,z) < N):
            ans[cal(x,y,z)] += func(x,y,z)
        while True:
            x = 1
            z = zt
            y += 1
            z -= 1
            zt = z
            if x > z or y > z:
                break
            if(cal(x,y,z) < N):
                ans[cal(x,y,z)] += func(x,y,z)
            for j in range(y - 1):
                if y < x + 1:
                    break
                x += 1
                z -= 1
                if x > z or y > z:
                    break
                if(cal(x,y,z) < N):
                    ans[cal(x,y,z)] += func(x,y,z)
    
    for i in range(1,N+1):
        print(ans[i])
        

def func(x,y,z):
    if x == y and y == z and z == x:
        return 1
    elif x != y and y != z and z != x:
        return 6
    else:
        return 3

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

main()

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
ans=n*[0]
count=1
while count<=6 and count<n:
    ans[count-1]=0
    count+=1
    if count==6:
        ans[count-1]=1
        count+=1

root=4
found=False
while not found:
    thing=math.ceil(int(root/3))
    while thing>0:
        s=root-thing
        a=int(s/2)
        b=s-a
        firstindex=root**2-(thing*a+a*b+thing*b)
        if firstindex>n:
            found=True
            break
        while a>=1 and b>=1:
            ways=len(set([thing,a,b]))
            index=root**2-(thing*a+a*b+thing*b)
            if index<=n:
                if ways==1:
                    ans[index-1]=1    
                elif ways==2:
                    ans[index-1]=3
                else:
                    ans[index-1]=6
                if a<b:
                    a-=1
                    b+=1
                else:
                    a+=1
                    b-=1
            else:
                break
        thing-=1
    root+=1

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

Submission status: Wrong Answer

Solution code:
n=int(input())
y=[0 for _ in range(10**4)]
for j in range(1,41):
   for k in range(1,58):
      for u in range(1,101):
         a=j*j+k*k+u*u+j*k+k*u+u*j
         if a < n+1:
            if j==k and k==u:
               y[a-1]=1
            elif j==k or k==u:
               y[a-1]=3
            else:
               y[a-1]=6
for o in range(n):
   print(y[o])

Submission status: Wrong Answer

Solution code:
import math


def xyz(n):
    rng = math.floor(math.sqrt(n))
    count = 0
    for x in range(1, rng):
        for y in range(x, rng):
            for z in range(y, rng):
                if (x+y) ** 2 + (y+z) ** 2 + (z+x) ** 2 == 2 * n:
                    count = check(x, y, z)
    return count


def check(a,b,c):
    count = 0
    if a == b and b == c:
        count = 1
    elif a == b:
        count = 3
    elif b == c:
        count = 3
    else:
        count = 6
    return count

N = int(input())
ans = [0] * (N+1)
for i in range(1, N+1):
    ans[i] = xyz(i)

for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())

lis = [0] * (10000+1)

for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            t = i**2 + j**2 + k**2 + i*j + j*k + i*k
            tmp = [i,j,k]
            
            if t <= 10001:
                if len(set(tmp)) == 1:
                    lis[t-1] = 1
                elif len(set(tmp)) == 2:
                    lis[t-1] = 3
                else:
                    lis[t-1] = 6

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
print(0)
print(0)
for i in range(3, N+1):
    ra = math.sqrt(i - 2) - 1
    ran = math.floor(ra)
    ans = 0
    for x in range(1, ran+1):
        for y in range(1, ran+1):
            for z in range(1, ran+1):
                f = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if i == f:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

for a in range(1, n + 1):
    cnt = 0
    x = 1
    y = 1
    z = 1
    while True:
        b = cal(x, y, z)
        if a == b:
            if x == y and y == z and z == x:
                cnt += 1
            else:
                cnt += 3
        
        if x > z:
            if y > z:
                z += 1
            else:
                y += 1
        else:
            x += 1
            y = 1
            z = 1
        if z > 10:
            break

    print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
for n in range(1,N):  
    ans=0
    for a in range(2,int((2*n)**(1/2))+1):
        for b in range(2,int((2*n)**(1/2))+1):
            

            if 2*n-a*a-b*b>=2 and (a+b+int((2*n-a*a-b*b)**(1/2)))%2==0 and int((2*n-a*a-b*b)**(1/2))==(2*n-a*a-b*b)**(1/2):
                c=int((2*n-a*a-b*b)**(1/2))
                if a+b-c>=2 and b+c-a>=2 and c+a-b>=2:
                    ans+=1
                    
    print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
la=list(range(2,10**2+1))
l=[]
for i in range(len(la)):
  l.append(la[i]**2)
for n in range(1,N+1):
  if n<6:
    print(0)
  else:
    c=0
    for x in range(len(l)):
      if l[x]*3>2*n:
        break
      else:
        for y in range(x,len(l)):
          if l[x]+2*l[y]>2*n:
            break
          else:
            for z in range(y,x+y+2):
              if z>len(l)-1:
                break
              if l[x]+l[y]+l[z]>2*n:
                break
              else:
                
                if l[x]+l[y]+l[z]==2*n:
                  
                  if (x+y+z)%2==0: 
                      if l[x]==l[y] and l[y]==l[z]:
                        c+=1
                      elif l[x]==l[y] or l[y]==l[z]:
                        c+=3
                      else:
                        c+=6
                   
    print(c)

Submission status: Wrong Answer

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

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            a = x**2 + y**2 + z**2 + x*y + y*z + z*x - 1
            if a <= 1000:
                num[a] += 1

num = num[:n]

for i in num:
    print(i)