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, re
import math
import numpy as np
from decimal import Decimal
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul	# 
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd	# 最大公約数
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.maxsize = 10 ** 15
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

# -*- coding: utf-8 -*-

n = INT()
ans = [0] * 15001

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

def A(x,y,z):
    out = check(x,y,z)
    if out > 15000:
        a = x + 1
        b = x
        c = x + 1
        if check(a,b,c) <= 15000:
            match = check(a,a,a)
            if match <= 15000:
                ans[match] += 1
            A(a,b,c)
    else:
        ans[out] += 3
        A(x,y,z+1)

ans[6] += 1
A(1, 1, 2)

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

Submission status: Wrong Answer

Solution code:
N=int(input())
cnt=[0]*(N+1)
li=[]
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            li.append(x**2+y**2+z**2+x*y+y*z+z*x)
for i in li:
    if i<=N:
        cnt[i]+=1
print(*cnt,sep='\n')

Submission status: Wrong Answer

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]


def main():
    N = int(input())
    ans = [0] * (10 ** 5)
    m = [0] * (10 ** 5)
    M = [0] * (10 ** 5)
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x <= y and y <= z:
                    n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                    if m[n - 1] != min(x, y, z) and M[n - 1] != max(x, y, z):
                        m[n - 1] = min(x, y, z)
                        M[n - 1] =max(x, y, z)
                        if x == y and y == z:
                            ans[n - 1] += 1
                        elif x == y or y == z or z == x:
                            ans[n - 1] += 3
                        else:
                            ans[n - 1] += 6
    s = [print(i) for i in ans[0 : N]]

                    
    
if __name__ == "__main__":
    main()

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(j,58):
      for u in range(k,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:
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)//2
      if f > 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] += 1
      elif x==y or y==z or z==x:
        
        ans[f] += 3
      else:
        
        ans[f] += 6
for a in ans[1:]:
  print(a)

Submission status: Wrong Answer

Solution code:
import sys
def ff(x,y,z):
    return(x**2+y**2+z**2+x*y+y*z+z*x)

n=int(input())
an = []
for i in range(1,50):
    for j in range(1,50):
        for k in range(1,50):
            wk=ff(i,j,k)
            if wk<=n:
                an.append(wk)
            else:
                break
ann=set(an)
annn=sorted(ann)
wk =0
if n<=5:
    for i in range(n):
        print(0)
    sys.exit()

for i in range(1,n+1):
    if i ==annn[wk]:
        if n==6:
            print(1)
        else:
            print(3)
            if wk+1>=len(annn):
                pass
            else:
                wk+=1
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = y = 1
index = {}
for x in range(1, 34):
    for y in range(x, 34):
        for k in range(3,100):
            z = k -x-y
            if z >= y:
                ans = (x + y + z) ** 2 - x*y -y*z -z*x
                if ans <= n:
                    if ans in index:
                        if x == y == z:
                            index[ans] = index[ans] + 1
                        else:
                            index[ans] = index[ans] + 3
                    else:
                        if x == y == z:
                            index[ans] = 1
                        else:
                            index[ans] = 3
for i in range(1, n+1):
    if i in index:
        print(index[i])
    else:
        print(0)

Submission status: Wrong Answer

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

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

for i in range(1,a+1):
	result=0
	for x in range(1,i+1):
		for y in (1,x+1):
			for z in range(1,y+1):
				if siki(x,y,z)>i:
					break
				if siki(x,y,z)==i:
					if x==y and y==z:
						result+=1
					elif x==y or x==z or y==z:
						result+=3
					else:
						result+=6
	print(result)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def calc(n):
    for i in range(1,int((n+1)**0.5)):
        for j in range(1,int((n+1)**0.5)):
            for k in range(1, int((n+1)**0.5)):
                if (i+j+k)**2 - i*j - j*k - k*i == n:
                    if i == j == k:
                        return 1
                    else:
                        return 3
    return 0    

def main():
    ans = 0
    n = int(input())
    for i in range(1,n):
        print(calc(i))

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if n>2:
    m=int(math.sqrt(n))
    for l in range(1,m+4):
        for i in range(1,l-1):
            for j in range(1,l-i):
                k=l-i-j
                N=i*i+j*j+k*k+i*j+j*k+k*i
                d[N]+=1
for i in range(1,n+1):
    print(d[i])

Submission status: Wrong Answer

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

for i in range(1, n + 1):
  cnt = 0
  for x in range(1, 35):
    for y in range(x,35):
      for z in range(y, 100):
        if (x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2 == i * 2:
          if x != y and y != z and z != x:
            cnt += 6
          elif x == y == z:
            cnt += 1
          else:
            cnt += 3
  ans.append(cnt)
for j in range(n):
  print(ans[j])

Submission status: Wrong Answer

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

for i in range(1, n + 1):
    n2 = floor(sqrt(i))
    ans = 0
    for x in range(1, n2):
        for y in range(1, n2):
            if i - (pow(x, 2) + pow(y, 2) + x * y) > 2:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
for n_m in range(N):
    n = n_m + 1

    result = 0


    lim_n = int(np.sqrt(n))

    done_list = []
    for x in range(1, lim_n):

        if (n-x**2 - 2*x) <= 0:
            continue
        lim_n_y = int(np.sqrt(n-x**2 - 2*x))
        for y in range(x, lim_n_y):
            
            if (n - y**2 - x ** 2 -x * y) <= 0:
                continue
            lim_n_z = int(np.sqrt(n - y**2 - x ** 2 -x * y ))+1
            for z in range(y, lim_n):

                if x**2 + y**2 + z**2 + (x+y+z)**2 == 2*n:

                    set_res = len(list(set([x,y,z])))
                    if  set_res == 1:
                        result += 1
                    elif set_res == 2:
                        result += 3
                    else:
                        result += 1
                            
                            
    print(result)

Submission status: Wrong Answer

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

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 - 1
            if a <= 1000:
                num[a] += 1

num = num[:n]

for i in num:
    print(i)

Submission status: Wrong Answer

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

for i in range(1,n//2+1):
    for j in range(1,int(n**0.5//6)+2):
        for k in range(j,int(n**0.5//6)+3):
            for l in range(k,int(n**0.5//6)+4):
                if ((j+k)**2+(k+l)**2+(l+j)**2)== 2*i:
                    if j == l:
                        L[i-1] += 1
                        break
                    if j < k < l:
                        L[i-1] += 6
                        break
                    else:
                        L[i-1] += 3
for m in range(n):
    print(L[m])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# atcoder 
# Türkler var mı?
# Herkese memnün oldum
import sys
import math

iimr = lambda: map(int, sys.stdin.readline().rstrip().split())
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
MOD = (10 ** 9) + 7  # operować sobie na typie int32_t


def 関数(n):
    res = 0
    limitex = math.ceil(math.sqrt(n))
    for x in range(1,limitex):
        limitey = math.ceil(math.sqrt(n) - math.sqrt(x))
        for y in range(1, limitey):
            limitez = math.ceil(math.sqrt(n) - math.sqrt(x) - math.sqrt(y))
            for z in range(1, limitez):
                if x*x + y*y + z*z + x*y + y*z + z*x == n:
                    res += 1
    return res

def çözmek():
    N = int(sys.stdin.readline())
    for i in range(1, N+1):
        print(関数(i))

if __name__ == "__main__":
    çözmek()

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:
import itertools
import math

a = int(input())
cnt = 0
ans = []
l = list(range(1,int(math.sqrt(a/2))))

for x,y,z in itertools.product(l, repeat=3):
	ans.append(x*x+y*y+z*z+x*y+y*z+z*x)

for i in range(1,a+1):
    print(ans.count(i))

Submission status: Wrong Answer

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

ans = [0]*(10**5)
for i1 in range(1, 10000):
    i2 = i1+1
    i3 = i1+2
    L = list(itertools.combinations_with_replacement((i1, i2, i3), 3))
    for i in L:
        i = list(i)
        x = i[0]
        y = i[1]
        z = i[2]
        n = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
        if n > 10**4:
            continue
        if len(list(set(i))) == 1:
            ans[n] += 1
        if len(list(set(i))) == 2:
            ans[n] += 3
        if len(list(set(i))) == 3:
            ans[n] += 6
        
for k in range(1, N+1):
    print(ans[k])

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(N):
    result = 0
    for j in range(N):
        for k in range(N):
            for l in range(N):
                if (j+1)^2 + (k+1)^2 + (l+1)^2 + (j+1)*(k+1) + (k+1)*(l+1) + (l+1)*(j+1) == i+1:
                    result +=1
    print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [0 for i in range(n+1)]
for i in range(1, n):
  x = (i**2)*6
  if x <= n:
    l[x] = 1
  else:
    break

x = 11
s = 7
for _ in range(10**9):
  if x <= n:
    l[x] = 3
    x += s
    s += 2
  else:
    break
    
x = 17
s = 17
for _ in range(10**9):
  if x <= n:
    l[x] = 3
    x += s
    s += 6
  else:
    break

l.pop(0)
for i in range(n):
  print(l[i])

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 b > a:
            break

    print(cnt)

Submission status: Wrong Answer

Solution code:
import math

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

    end = math.ceil(3*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:
n=int(input())
for i in range(1,n+1):
    a=0
    ii=int((i**0.5)+1)
    x=1
    for x in range(1,(ii//3)+1):
        y=x
        while(x+(2*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 math

n = int(input())

for i in range(1, n + 1):
    cnt = 0
    
    n = i
    x = 1
    y = 1

    ans = []

    while x < n:
        if x ** 2 + x > i:
            break

        while y < n:
            if y in ans and x in ans:
                break
            if y ** 2 + y > i:
                break

            try:
                z = (math.sqrt(4 * i - 3 * y ** 2 - 2 * x * y - 3 * x ** 2) - x - y) / 2
            
            except:
                y += 1
                continue

            if z > 0 and z.is_integer():
                if x == y:
                    if y == z:
                        cnt += 1
                    else:
                        cnt += 3
                elif x == z:
                    cnt += 3
                elif y == z:
                    cnt += 3
                else:
                    cnt += 6
                ans.append(x)
                ans.append(z)
                ans.append(y)
                n = max(z, x, y)           
                break

            y += 1
        x += 1

    print(cnt)

Submission status: Wrong Answer

Solution code:
n = 10**4
k = [0]*10**4
for x in range(1,9):
    for y in range(1,9):
        for z in range(1,9):
            for i in range(n+1):
                if (x+y+z)**2 -(x*y+y*z+z*x) == i:
                    k[i-1] += 1
for i in range(int(input())):
    print(k[i])

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
f = [0] * N
n = list(range(1,N+1))
for i in range(N):
    n[i] = math.ceil(math.sqrt(n[i]))

for i in range(1,N+1):
    for x in range(1,n[i-1]):
        if(x*x > i):
            break 
        for y in range(x,n[i-1]):
            if(x*x+y*y+x*y > i):
                break
            for z in range(y,n[i-1]):
                if(x*x+y*y+z*z+x*y+y*z+z*x > i):
                    break
                elif(x*x+y*y+z*z+x*y+y*z+z*x == i):
                    if(x == y and y == z) :
                        f[i-1] += 1
                    elif(x == y and y < z):
                        f[i-1] += 3
                    elif(x < y and y == z):
                        f[i-1] += 3
                    else:
                        f[i-1] += 6
                break
                


[print(a) for a in f]

Submission status: Wrong Answer

Solution code:
### Problem C
import math

N = int(input())

for x in range(1,N+1):
    cnt = 0
    if x < 2000:
        up = int(math.sqrt(x))+1
    else:
        up = int(math.sqrt(x))-30
    for i in range(1,up):
        for j in range(1,up-(i-1)):
            for k in range(1,up-(i-1)-(j-1)):
                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())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

lis = [0] * (10000+1)

for i in range(1, 100):
    for j in range(1, 65):
        for k in range(1, 65):
            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] = 9

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

Submission status: Wrong Answer

Solution code:
n = int(input())
fn = [0] * (10**7+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)
            fn[idx] += 1
for i in range(1, n+1):
    print(fn[i])

Submission status: Wrong Answer

Solution code:
import math
import sys
import itertools
from math import gcd
from math import sqrt
from sys import stdin
def input() : return stdin.readline().rstrip()
def mips():
    return map(int,input().split())
def ii():
    return int(input())
sys.setrecursionlimit(10**9)

N = ii()
did = 1
while did != N+1:
    mark = math.ceil(sqrt(did))
    count = 0
    for x in range(1,mark):
        if x ** 2 >= did or (x+abs(mark-x) + abs(mark-max(x,abs(mark-x))))**2 < did:
            break
        for y in range(1,abs(mark-x)):
            if x ** 2 + y ** 2 + x*y >= did:
                break
            mark2 = math.ceil(sqrt(did-x**2 - y**2 - x*y))
            for z in range(math.floor(sqrt(did-x**2-y**2-x*y)),did):
                if (x+y+z)**2 - (x*y + x*z + y*z) == did:
                    count += 1
    print(count)
    did += 1

Submission status: Wrong Answer

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

N = int(input())
for n in range(1 , N + 1):
    ans = 0
    for x in range(1, 101):
        xxx = ans_xyz(x, x, x)
        if xxx > n:
            break
        elif xxx == n:
            ans += 1
            break
        for y in range(x + 1, 101):
            xxy = ans_xyz(x, x, y)
            if xxy > n:
                break
            elif xxy == n:
                ans += 3
                break
            for z in range(y + 1, 101):
                if ans_xyz(x, y, z) > n:
                    break
                elif ans_xyz(x, y, z) == n:
                    ans += 6
                    break
            xyy = ans_xyz(x, y, y)
            if xyy > n:
                break
            elif xyy == n:
                ans += 3
                break
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
for n_m in range(N):
    n = n_m + 1

    result = 0


    lim_n = int(np.sqrt(n))

    done_list = []
    for x in range(1, lim_n):

        if (n-x**2 - 2*x) <= 0:
            continue
        lim_n_y = int(np.sqrt(n-x**2 - 2*x))
        for y in range(x, lim_n_y):
            
            if (n - y**2 - x ** 2 -x * y) <= 0:
                continue
            lim_n_z = int(np.sqrt(n - y**2 - x ** 2 -x * y ))
            for z in range(y, lim_n):

                if x**2 + y**2 + z**2 + (x+y+z)**2 == 2*n:

                    set_res = len(list(set([x,y,z])))
                    if  set_res == 1:
                        result += 1
                    elif set_res == 2:
                        result += 3
                    else:
                        result += 1
                            
                            
    print(result)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
def search(n):
    global N
    for x in range(1, N + 1):
        xx = x*x
        if n - xx <= 0:
            return None
        for y in range(1, N + 1):
            yy = y*y
            xy = x*y
            if n - xx - yy - xy <= 0:
                break
            z = binarySearch(n, x, y, xx + yy + xy)
            if z:
                return (x, y, z)


def binarySearch(n, x, y, t):
    global N
    right = -1
    left = N + 1
    while(abs(right - left) > 1):
        z = left + (right - left) // 2
        l = t + z*z + y*z + z*x
        if l == n:
            return z
        elif l < n:
            right = z
        else:
            left = z
        # print(right, left, z)
    return None

ans = list()
for n in range(1, N+1):
    xyz = search(n)
    if xyz == None:
        ans.append("0")
        continue
    t = len(set(xyz))
    if t == 1:
        ans.append("1")
    elif t == 2:
        ans.append("3")
    else:
        ans.append("6")

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

Submission status: Wrong Answer

Solution code:
N=int(input())
for h in range(1,N+1):
    num=0
    for i in range(1,h-5):
        for j in range(1,h-5):
            for k in range(1,h-5):
                if i**2+j**2+k**2+i*j+j*k+k*i==h:
                    num+=1
    print(num)

Submission status: Wrong Answer

Solution code:
n = 10**4
k = [0]*10**4
for x in range(1,6):
    for y in range(1,6):
        for z in range(1,6):
            for i in range(n+1):
                if (x+y+z)**2 -(x*y+y*z+z*x) == i:
                    k[i-1] += 1
for i in range(int(input())):
    print(k[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
fn = [0] * (10**6+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)
            fn[idx] += 1
for i in range(1, n+1):
    print(fn[i])

Submission status: Wrong Answer

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())

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
            if j==i:
                d = 1
            else:
                d = 3
            c[tmp-1] += d
        
        #if not fa:
        #    break

    for rep in c:
        print(rep)
    return

if __name__=='__main__':
    Main()

Submission status: Wrong Answer

Solution code:

n=int(input())
ans = []
for i in range(n+1):
    ans.append(0)
for x in range(2,101):
    for y in range(2,x+1):
        if x*y + 1 > n:
            break
        for z in range(1,100):
            if x+y-2*z > 0 and y - z > 0 and x*y+(x-z)**2+(y-z)**2 < n+1:
                m=x*y+(x-z)**2+(y-z)**2
                if x == y and x-z == z:
                    ans[m] = ans[m]  + 1
                elif x == y or  x-z  == z or y-z == z:
                    ans[m] = ans[m]  + 3
                else:
                    ans[m] = ans[m]  + 6
for i in range(1,n+1):
    print(ans[i])

Submission status: Wrong Answer

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

ans = [0]*(10**5)
for i1 in range(1, 10000):
    i2 = i1+1
    i3 = i1+2
    L = list(itertools.combinations_with_replacement((i1, i2, i3), 3))
    for i in L:
        i = list(i)
        x = i[0]
        y = i[1]
        z = i[2]
        n = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
        if n > 10**4:
            break
        if len(list(set(i))) == 1:
            ans[n] += 1
        if len(list(set(i))) == 2:
            ans[n] += 3
        if len(list(set(i))) == 3:
            ans[n] += 6
        
for k in range(1, N+1):
    print(ans[k])

Submission status: Wrong Answer

Solution code:
n = 10**4
k = [0]*10**4
for x in range(1,5):
    for y in range(1,5):
        for z in range(1,5):
            for i in range(n+1):
                if (x+y+z)**2 -(x*y+y*z+z*x) == i:
                    k[i-1] += 1
for i in range(int(input())):
    print(k[i])

Submission status: Wrong Answer

Solution code:
n = int(input())

for a in range(n+1):
    ans = 0
    for i in range(1,100):
        for j in range(1,100):
            if i*2 + j*2 + i*j >= a:
                break
            for k in range(1,100):
                if i**2 + j**2 + k**2 +i*j + j*k + k*i == a:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
input_number = input()
for n in range(int(input_number)):
	n += 1
	count = 0
	for x in range(1,101):
		function_x = x*x
		if function_x > n:
			break
		for y in range(1,101):
			function_xy = x*x+y*y+x*y
			if x > y:
				break
			if function_xy > n:
				break
			for z in range(1,101):
				function = x*x+y*y+z*z+x*y+y*z+x*z
				if y > z:
					break
				if function > n:
					break
				if n == function:
					if x == y and y == z:
						count += 1
					elif x == y or x == z or x == z:
						count += 3
					else:
						count += 6
	print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

lis = [0] * (10000+1)

for i in range(1, 100):
    for j in range(1, 65):
        for k in range(1, 65):
            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())
ls = [0]*15000

for i in range(1,42):
    for j in range(1,42):
        for k in range(1,42):
            t = i**2 + j**2 + k**2 + i*j + j*k + k*i 
            ls[t] += 1

for p in range(1,N+1):
    print(ls[p])

Submission status: Wrong Answer

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


for k in range(1, n+1):
    flag=False
    for x in range(1, 70):
        if 6*x**2 > k:
            break
        else:
            for y in range(x, 70):
                for z in range(y, 70):
                    if (x+y+z)**2 - x*y-y*z-z*x==k:
                        comb.append((x,y,z))
                        flag=True
                        break
    
    if flag:
        pass
    else:
        comb.append((0, 0, 0))


for s in range(n):
    if comb[s][0]==comb[s][1]==comb[s][2]==0:
        ans.append(0)
    elif comb[s][0]==comb[s][1]==comb[s][2]!=0:
        ans.append(1)
    elif comb[s][0]!=comb[s][1] and comb[s][1]!=comb[s][2] and comb[s][2]!=comb[s][0]:
        ans.append(6)
    else:
        ans.append(3)

for i in range(n):
    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,30):
		for y in range(1,30):
			for z in range(1,30):
				if x**2 + y**2 + z**2 + (x*z) + (x*y) + (y*z) == i:
					cnt += 1
	print(cnt)

Submission status: Wrong Answer

Solution code:
import itertools
N = int(input())
rng = int(-(-N**0.5//1))
pat_list = list(itertools.product(range(1,rng),repeat=3))
cnt_list = [0 for i in range(rng**2*6)]
for X, Y, Z in pat_list:
    cnt_list[X**2+Y**2+Z**2+X*Y+Y*Z+Z*X] += 1

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

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    
    n = int(input())

    for o in range(1, 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 or isOver: break
        if not isFound: print(0)

Submission status: Wrong Answer

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

ans = [0]*n
for i in range(n):
	for x in range(1,100):
		for y in range(1,100):
			if pow(x+y,2) - 4*(pow(x,2) + x*y +pow(y,2) - i) >= 0:
				p = (1/2)*(-(x+y) + math.sqrt(pow(x+y,2) - 4*(pow(x,2) +x*y +pow(y,2) - i)))
				q = (1/2)*(-(x+y) - math.sqrt(pow(x+y,2) - 4*(pow(x,2) +x*y +pow(y,2) - i)))
				if (p%1 == 0 and p >= 1) or (q%1 == 0 and q >= 1):
					ans[i] += 1
for i in range(n):
	print(ans[i])