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:
s1 = input().split()
intN = int(s1[0])

i = 0
while i <= intN :
    cnt = 0
    wkX = 1
    while wkX <= intN -2 :
        if (wkX * wkX > intN -2) : 
            break
        wkY = 1
        while wkY <= intN - 2 :
            if (wkY * wkY > intN -2) : 
                break
            if (wkX * wkY > intN -2) : 
               break
            wkZ = 1
            while wkZ <= intN - 2 :
                if (wkZ * wkZ > intN -2) : 
                   break
                if (wkY * wkZ > intN -2) : 
                    break
                if (wkZ * wkX > intN -2) : 
                    break
                intFn = wkX * wkX + wkY * wkY + wkZ * wkZ + wkX * wkY + wkY * wkZ + wkZ * wkX
                if (intFn == i) :
                    cnt += 1
                wkZ += 1
            wkY += 1
        wkX += 1
    print(cnt)
    i += 1

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [0]*(10**4)

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0]*N
n = int((N)**(0.5))+1
for x in range(1, n):
    for y in range(1, n):
        for z in range(1, n):
            i = x**2+y**2+z**2+x*y+x*z+y*z
            if i > N-1:
                break
            else:
                ans[i-1] += 1
for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[0]*n
for i in range(3,int(n**0.5+150)):
  for j in range(1,i-1):
    for k in range(1,i-j):
      if (x:=i*i-j*k-k*(l:=i-j-k)-l*j)<=n:
        A[x-1]+=1
print(A[-30:-1])

Submission status: Wrong Answer

Solution code:
import math
from itertools import combinations_with_replacement

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


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

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

[print(a) for a in ans]

Submission status: Wrong Answer

Solution code:
N=int(input())
for i in range(N):
  count=0
  k=i//5+1
  for x in range(k):
    if(x==0):
      continue
    for y in range(k):
      if(y==0):
        continue
      for z in range(k):
        if(z==0):
          continue
        if((x+y)**2+(y+z)**2+(z+x)**2)//2==i:
          #print(x,y,z)
          count+=1
  print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import statistics
import itertools
from collections import deque
n=int(input())
#n,m=map(int,input().split()))
#lis=list(map(int,input().split()))
#side=[]
#for _ in range(m):
    #side.append(tuple(map(int,input().split())))
ans_lis =[0]*100000

per_lis=itertools.permutations(list(range(1,4)))

for i in range(1,11):
    for j in range(1,11):
        for k in range(1,11):
            tmp=i**2+j**2+k**2+i*j+j*k+k*i
            if i==j and j==k:
                ans_lis[tmp-1]=1
            elif i==j and i!=k:
                ans_lis[tmp-1]=3
            elif i!=j and i==k:
                ans_lis[tmp-1]=3
            elif j==k and i!=j:
                ans_lis[tmp-1]=3
            else:
                ans_lis[tmp-1]==6

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

Submission status: Wrong Answer

Solution code:
def main():
        
    import math

    N = int(input())

    for n in range(1, N + 1):
        max_itr = min(101, int(math.sqrt(n)) + 1)
        
        ans_list = []
        ans = 0
        
        for x in range(1, max_itr):
            for y in range(1, x+1):
            # for y in range(1, max_itr):

                for z in range(1, x+1):
                # for z in range(1, max_itr):

                    left_eq = x * x + y * y + z * z + x * y + y * z + z * x
                    if (left_eq == n):
                        ans_list = [x, y, z]
                        ans_len = len(set(ans_list))
                        
                        # ans += 1
                        
                        if (ans_len==3):
                            ans += 6
                        elif (ans_len == 2):
                            ans += 3
                        else:
                            ans += 1

        
        
        print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

Solution code:
n = int(input())

def culc(number):
    count = 0
    num = int(number ** 0.5)
    for i in range(1, num+1):
        for j in range(1, num+1):
            for k in range(1, num+1):
                tmp = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
                if tmp == number:
                    count += 1
                if tmp > number:
                    break
            else:
                continue
            break
        else:
            continue
        break

    return count

for i in range(1, n+1):
    if i < 6:
        print(0)
    elif i == 6:
        print(1)
    else:
        print(culc(i))

Submission status: Wrong Answer

Solution code:
N = int(input())
k = 1
for i in range(1,N+1):
    if i == 6*k**2:
        print(1)
    elif i == (2*k)**2 + 3 * k**2 + 2*(k*(k+1)):
        print(3)
    elif i == 3*((2*k)**2) + 2*k*(k+1) + k**2:
        print(3)
    elif i == (k+2)**2 + 3*k**2 + 2*k*(k+2):
        print(3)
        k +=1
    else:
        print(0)

Submission status: Wrong Answer

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


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


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


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

Submission status: Wrong Answer

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

for f in range(1,n+1):
    for x in range(1, f//5):
        for y in range(1, f//5):
            for z in range(1, f//5):
                if(x*x+y*y+z*z+x*y+y*z+z*x == f):
                    count[f-1]+=1

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
x = 0
y =0 
z =0

for m in range(N+1):
  l = math.sqrt(m+1)
  li = int(l)
  count =0
  for i in range(li):
    x = i+1
    for k in range(x):
      y = k+1
      for j in range(y):
        z = j+1
        n = x*x+y*y+z*z+x*y+y*z+z*x
        if n==m:
          if  x==y or y==z or z==x:
            if x==y and y == z:
              count =count+1
            else:
              count = count+3
          else:
            count =count+6

  print(count)

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
n = int(N ** (1/2))
C = itertools.combinations_with_replacement(range(1, n + 1), 3)
ans = [0 for i in range(N)] 

x, y, z = 1, 1, 1

def check(c):
  x, y, z = c
  global N
  t = x * x + y * y + z * z + x * y + y * z + z * x
  if t > N:
    return
  if x == y and y == z:
    ans[t - 1] += 1
  elif x == y and y != z or y == z and z != x or z == x and x != y:
    ans[t - 1] += 3
  else:
    ans[t - 1] += 6

for c in list(C):
  check(c)
print(ans)

Submission status: Wrong Answer

Solution code:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################
n = int(input())
arr = set()
ans = []
temp1 = 0
for i in range(1,n+1):
	temp2 = 0
	for j in range(1,n+1):
		temp3 = 0
		for k in range(1,n+1):
			arr.add(i*i + j*j + k*k + i*j + j*k + k*i)
			temp3 = i*i + j*j + k*k + i*j + j*k + k*i
			#print(temp3, i+j+k)
			if temp3 > n:break
		temp2 = i*i + j*j + 1 + i*j + j + i
		if temp2 > n: break
	temp1 = i*i + 1 + 1 + i + 1 + i
	if temp1 > n:
		break
	


#print(arr)
for i in range(1,n+1):
	if i in arr:
		ans.append(3)
	else:
		ans.append(0)
for i in ans:
	print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

from itertools import product
from functools import lru_cache

N = int(input().rstrip())

@lru_cache(maxsize=1024)
def judge(n):
    cnt = 0
    num = 1
    num_lst = [num]
    size = True
    while size:
        for x, y, z in product(num_lst, repeat=3):
            judge = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if judge == n:
                cnt += 1
                size = False
            elif judge > n:
                size = False
        num += 1
        num_lst.append(num)
    print(cnt)

for i in range(1, N+1):
    judge(i)

Submission status: Wrong Answer

Solution code:


a={}
for i in range(1,45):
    for j in range(i,45):
        for k in range(j,45):
            n=i*i+j*j+k*k+i*j+i*k+j*k
       
            if n not in a:
                if i==j and j==k:
                    a[n]=1
                elif i==j or j==k or i==k:
                    a[n]=3
                else:
                    a[n]=6
            else:
                if i==j and j==k:
                    a[n]+=1
                elif i==j or j==k or i==k:
                    a[n]+=3
                else:
                    a[n]+=6

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

Submission status: Wrong Answer

Solution code:
import math
from itertools import combinations_with_replacement

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


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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
x = 1
y = 1
z = 1
listN = []
while x<=98:
    y =1
    z =1
    while y<=98:
        z = 1
        while z<=98:
            ans = x**2+y**2+z**2+x*y+y*z+z*x
            if ans<=10000:
                listN.append(ans)
                z = z+1
            else:
                break
        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:
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[i]<=l[k]+l[j] and 2+l[k]<=l[i]+l[j] and 2+l[j]<=l[i]+l[k]:
                
                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:
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 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:
import math
    

n = int(input(''))

mx=int(math.sqrt(n))+1

fmap = {}

for x in range(1,mx):
    for y in range(x,mx):
        for z in range(y,mx):
            ans = x**2 + y**2 + z**2 + x*y + y*z + x*z
            if x==y and y==z:
                fmap[ans] = 1
            elif x==y or y==z or x == z:
                fmap[ans] = 3
            else:
                fmap[ans] = 6

for i in range(1,n+1):
    if i in fmap.keys():
        print(fmap[i])
    else:
        print(0)

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*x+y*y+z*z+x*y+x*z+y*z:
      ans+=1
 print(ans)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())
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(1,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:
from itertools import product

n = int(input())
pro = product([x for x in range(1,7)],repeat=3)
lst = [0]*n
for p in pro:
    for i in range(1,n+1):
        if ((p[0]**2) + (p[1]**2) + (p[2]**2) + (p[0]*p[1]) + (p[1]*p[2]) + (p[2]*p[0])) == i:
            lst[i-1]+=1
for i in lst:
    print(i)

Submission status: Wrong Answer

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

for i in range(1,5):
    print(0)

for i in range(6,n+1):
    cnt=0
    sq=int(math.sqrt((n/6)))
    for x in range(1,sq):
        for y in range(x,i):
                for z in range(y,i):
                    if x**2+y**2+z**2+x*y+y*z+z*x==i:
                        if x==y and y==z:
                            cnt+=1
                        if x==y and y!=z:
                            cnt+=3
                        if x!=y and y==z:
                            cnt+=3
                        if x==z and y!=z:
                            cnt+=3
                        if x!=y and y!=z and z!=x:
                            cnt+=6

    print(cnt)

Submission status: Wrong Answer

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

N=int(input())

A=[]
for i in range(50):
    A.append(i+1)

D=list(itertools.combinations_with_replacement(A, 3))
#print(len(D))
for j in range(N):
    count=0
    for sa in D:
    
        if ((sa[0]+sa[1]+sa[2])**2)-(sa[0]*sa[1]+sa[1]*sa[2]+sa[2]*sa[0])==j+1:
            if sa[0]!=sa[1] and sa[1] !=sa[2]:
                
                count+=6
            elif sa[0]==sa[1] and sa[1]==sa[2]:
                count+=1
            else:
                count+=3

    print(count)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
from collections import deque

N = int(input())

ans = [0] * (N+5)
queue = deque()
queue.append((1,1,1))
total = 0
seen = set()

seen.add((1,1,1))
while queue:
    x,y,z = queue.popleft()
    total = x ** 2 + y ** 2 + z ** 2 + x*y + y*z + z*x

    if total - 1 <= N-1:
        ans[total-1] += 1
    if total >= N:
        break

    if (x+1,y,z) not in seen:   
        queue.append((x+1,y,z))
        seen.add((x+1,y,z))
    if (x,y+1,z) not in seen:    
        queue.append((x,y+1,z))
        seen.add((x,y+1,z))
    if (x,y,z+1) not in seen:
        queue.append((x,y,z+1))
        seen.add((x,y,z+1))
for i in range(N):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
n = int(input())
cnt = [0] * (1 + n)
for a in range(1, 33):
    for b in range(1, 33):
        for c in range(1, 33):
            k = a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a
            if k > n:
                continue
            else:
                cnt[k] += 1
for i in range(1, n + 1):
    print(cnt[i])

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(1,N+1):
    ans = 0
    tri = 0
    if i < 6:
        print(0)
        continue
    for j in range(1,int(i**0.5)+1):
        if j < tri:
            continue
        for k in range(1,int(i**0.5)+1):
            if j < tri:
                continue
            for m in range(1,int(i**0.5)+1):
                if j**2 + k**2 + m**2 +j*k + j*m + m*k == i:
                    if m != k:
                        tri = k
                        ans += 3
                        break
                    ans += 1
                    break
                if j**2 + k**2 + m**2 +j*k + j*m + m*k > i:
                    break
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())


def check(x, y, z, n):
    if x*x+y*y+z*z+x*y+y*z+z*x == n:
        return True
    return False


for x in range(n):
    count = 0
    for i in range(1, 1+x):
        for j in range(1, 1+x):
            for k in range(1, 1+n):
                if check(i, j, k, x):
                    count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
from itertools import product

n = int(input())
pro = product([x for x in range(1,5)],repeat=3)
lst = [0]*n
for p in pro:
    for i in range(1,n+1):
        if ((p[0]**2) + (p[1]**2) + (p[2]**2) + (p[0]*p[1]) + (p[1]*p[2]) + (p[2]*p[0])) == i:
            lst[i-1]+=1
for i in lst:
    print(i)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=int(N**(0.3537))
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:
def resolve():
    '''
    code here
    '''
    import math
    N = int(input())

    num_max = int(math.sqrt(N)) +1

    n_list = [False for _ in range(N+2)]
    for i in range(1, num_max+1):
        for j in range(1, num_max+1):
            for k in range(1, num_max+1):
                if i**2+j**2+k**2+i*j+j*k+k*i <= N:
                    n_list[i**2+j**2+k**2+i*j+j*k+k*i] = [i, j, k]
    
    
    for i in range(1, N+1):
        temp = n_list[i]
        if temp:
            x, y, z = temp
            if len(set([x, y, z])) == 1:
                print(1)
            elif len(set([x, y, z])) == 2:
                print(3)
            else:
                print(6)
        else:
            print(0)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
ans = [0]*n
max = int(math.sqrt(max(n-2,1)))

for x in range(1,max):
  for y in range(1,max):
    for z in range(1,max):
      ns = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if ns < n:
        ans[ns-1] += 1
for a in range(n):
  print(ans[a])

Submission status: Wrong Answer

Solution code:
def f(n):
    res = 0
    for x in range(1, 100):
        for y in range(x, 100):
            temp = 4 * n - 3 * (x + y) ** 2 + 4 * x * y
            if (x + y) % 2:
                continue
            elif temp < 0:
                continue
            elif format(temp, 'b').count('1') != 1:
                continue
            z1 = - (x + y) // 2 + int(temp ** .5) // 2
            z2 = - (x + y) // 2 - int(temp ** .5) // 2
            if z1 >= 1:
                if x == y == z1:
                    res += 1
                elif x != y != z1:
                    res += 6
                else:
                    res += 3
            if z2 >= 1:
                if x == y == z2:
                    res += 1
                elif x != y != z2:
                    res += 6
                else:
                    res += 3
    return res


N = int(input())
for i in range(1, N + 1):
    print(f(i))

Submission status: Wrong Answer

Solution code:
from itertools import combinations
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:
                kari=[x,y,z]
                ans[x**2+y**2+z**2+x*y+y*z+z*x-1]=len(list(combinations(kari,2)))
if N>=6:
    ans[5]=1
for i in range(N):
    print(ans[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

memo = {}
for i in range(1,n//2+1):
  for j in range(1,n//2+1-i):
    for k in range(1,n//2+1-i-j):
      key = str(i)+str(j)+str(k)
      memo[key] = i**2+j**2+k**2+i*j+j*k+k*i

print(memo)
val = [num for num in memo.values()]

for i in range(1,n+1):
  print(val.count(i))

Submission status: Wrong Answer

Solution code:
import sys
import math
import statistics
import itertools
from collections import deque
n=int(input())
#n,m=map(int,input().split()))
#lis=list(map(int,input().split()))
#side=[]
#for _ in range(m):
    #side.append(tuple(map(int,input().split())))
ans_lis =[0]*100000

per_lis=itertools.permutations(list(range(1,4)))

for i in range(1,11):
    for j in range(1,11):
        for k in range(1,11):
            tmp=i**2+j**2+k**2+i*j+j*k+k*i
            if i==j and j==k:
                ans_lis[tmp-1]=1
            elif i==j and i!=k:
                ans_lis[tmp-1]=3
            elif i!=j and i==k:
                ans_lis[tmp-1]=3
            elif j==k and i!=j:
                ans_lis[tmp-1]=3

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

Submission status: Wrong Answer

Solution code:
import math
    

n = int(input(''))

mx=int(math.sqrt(n))+1

fmap = {}

for x in range(1,mx):
    for y in range(x,mx):
        for z in range(y,mx):
            ans = x**2 + y**2 + z**2 + x*y + y*z + x*z
            if x==y and y==z:
                fmap[ans] = 1
            elif x==y or y==z:
                fmap[ans] = 3
            else:
                fmap[ans] = 6

for i in range(1,n+1):
    if i in fmap.keys():
        print(fmap[i])
    else:
        print(0)

Submission status: Wrong Answer

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

n = int(input())

ans = 0
arr = []
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            arr.append(func(x,y,z))
for i in range(n):
    print(arr.count(i))

Submission status: Wrong Answer

Solution code:
def f(n):
    cnt = 0
    for x in range(1,3):
        for y in range(1, 3):
            for z in range(1,3):
                if (((x**2 )+(y**2) +(z**2) +x*y +y*z+ z*x)) == n:
                    cnt += 1

    return cnt
N=int(input())
for i in range(1,N+1):
    print(f(i))

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,22):
            if (x**2+y**2+z**2+x*y+y*z+z*x) <= N:
                n = int(0.5*((x+y)**2+(y+z)**2+(z+x)**2))
                if x == y and y == z and z == x:
                    ans[n-1] = 1
                elif x == y or y == z or z == x:
                    ans[n-1] = 3
                elif x != y and y != z and z != x:
                    ans[n-1] = 6
for output in ans:
    print(output)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
nn=int(math.sqrt(n))
for i in range(1,n+1):
    count=0
    for x in range(1,nn+1):
        for y in range(x,nn+1):
            for z in range(y,nn+1):
                #print(x*x+y*y+z*z+x*y+y*z+z*x)
                if (x*x+y*y+z*z+x*y+y*z+z*x)==i:
                    if x==y and y==z and z==y:
                        count+count+1
                    elif x!=y and y!=z and z!=y:
                        count=count+6
                    else:
                        count=count+3
    print(count)

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):
                n = x*x + y*y + z*z + x*y + y*z + z*x
                if i == n:
                    cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:

n = int(input())
#print(n)

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

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

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

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=int(N**(0.3535))
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 itertools

N=int(input())
L=[0]*(10**4+10)
X=[x for x in range(1,13)]
plus=[0,1,3,6]

for v in itertools.combinations_with_replacement(X,3):
  x,y,z=v[0],v[1],v[2]
  temp=len(set(v))
  L[x**2+y**2+z**2+x*y+y*z+z*x]+=plus[temp]


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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

for r in result:
    print(r)

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:
                    break
    print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0]*60010

for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            s = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if i == j and i == k:
                a[s] = 1
            elif i == j and i != k:
                a[s] = 3
            elif i == k and i != j:
                a[s] = 3
            elif j == k and j != i:
                a[s] = 3
            else:
                a[s] = 6

for m in range(1,n+1):
    print(a[m])

Submission status: Wrong Answer

Solution code:
from itertools import product

n = int(input())
pro = product([x for x in range(1,4)],repeat=3)
lst = [0]*n
for p in pro:
    for i in range(1,n+1):
        if ((p[0]**2) + (p[1]**2) + (p[2]**2) + (p[0]*p[1]) + (p[1]*p[2]) + (p[2]*p[0])) == i:
            lst[i-1]+=1
for i in lst:
    print(i)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
A=[]

for i in range(1,150):
    for j in range(1,150):
        for k in range(1,150):
            ans=(i**2+j**2+k**2+i*j+j*k+k*i)
            if ans<=N:
                A.append(ans)
B=Counter(A)

print(B)
for a in range(1,N+1):
   if a in B.keys():
        print(B[a])
   else:
       print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [0 for x in range(n)]
sq = int(n ** 0.5)
for i in range(1, sq):
    for j in range(1, sq):
        for k in range(1, sq):
            ans = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if ans < n:
                arr[ans-1] += 1
for i in arr:
    print(i)

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())

for n in range(N):
  c = 0
  for x in range(100):
    for y in range(100):
      for z in range(100):
        if x**2 + y**2 + z**2 + x*y + x*z + y*z == n:
          c += 1
  print(c)

Submission status: Wrong Answer

Solution code:
def func(n):
    cnt = 0
    for x in range(1, 34):
        for y in range(1, 34):
            z = 1
            while(x**2+y**2+z**2+x*y+y*z+z*x <= n):
                if(x**2+y**2+z**2+x*y+y*z+z*x == n):
                    cnt += 1
                    break
                z += 1
    return cnt

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

    for i in range(1, N+1):
        print(func(i))
        
main()