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
#input = sys.stdin.readline

import math
from collections import defaultdict,deque
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""
n=ii()
d=defaultdict(int)
for i in range(1,90):
    for j in range(1,90):
        for k in range(1,90):
            w=i*i+j*j+k*k+i*j+i*k+j*k
            d[w]+=1
for i in range(1,n+1):
    print(d[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
for n in range(1,N+1):
    s=0
    for x in range(1,101):
        for y in range(1,101):
            for z in range(1,101):
                fn=x*x+y*y+z*z+x*y+y*z+z*x
                if fn==n:
                    s=s+1
    print(n,s)

Submission status: Wrong Answer

Solution code:
# this is the third task 
from collections import defaultdict
N=int(input())
n=1
s=3
brkLoop=False
while True :
    r=(s)**2-(1)-(1)-(n)
    if ( r >= N ):
        break;  
    else:
        n=n+1   
        s=s+1
out=defaultdict(list)
for (x,y,z) in tuple((i,j,k) for i in range(1, n+1) for j in range (1,n+1) for k in range(1,n+1)):
    r=(x+y+z)**2-(x*y)-(y*z)-(x*z)
    if ( r <= N ):
        out[r].append((x,y,z))

for i in range(1,N+1):
    if ( i in out):
        print (f'{i}:{len(out[i])}')
    else:
        print(f'{i}:0')

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0

i = 1

count = 0
limit = 100

nums = [0] * n

for x in range(limit):
    for y in range(limit):
        for z in range(limit):
            cal =  (x + 1) ** 2 + (y + 1) ** 2 + (z + 1) ** 2 + (x + 1) * (y + 1) + (y + 1) * (z + 1) + (z + 1) * (x + 1)
            if(cal > n):
                break
            nums[cal - 1] += 1

for x,n in enumerate(nums,1):
    if ( n > 0 ):
        print(f'{x}:{n}')

Submission status: Wrong Answer

Solution code:
# this is the third task 
from collections import defaultdict
N=int(input())
n=1
s=3
brkLoop=False
while True :
    r=(s)**2-(1)-(1)-(n)
    if ( r >= N ):
        break;  
    else:
        n=n+1   
        s=s+1
out=defaultdict(list)
for (x,y,z) in tuple((i,j,k) for i in range(1, n+1) for j in range (1,n+1) for k in range(1,n+1)):
    r=(x+y+z)**2-(x*y)-(y*z)-(x*z)
    if ( r < N ):
        out[r].append((x,y,z))
for i in range(1,N+1):
    if ( i in out):
        print (len(out[i]))
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
# this is the third task 
from collections import defaultdict
N=int(input())
n=1
s=3
brkLoop=False
while True :
    r=(s)**2-(1)-(1)-(n)
    if ( r >= N ):
        break;  
    else:
        n=n+1   
        s=s+1
out=defaultdict(list)
for (x,y,z) in tuple((i,j,k) for i in range(1, n+1) for j in range (1,n+1) for k in range(1,n+1)):
    r=(x+y+z)**2-(x*y)-(y*z)-(x*z)
    if ( r < N ):
        out[r].append((x,y,z))
for i in range(1,N):
    if ( i in out):
        print (len(out[i]))
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
xyz = [0] * ((10 ** 6) + 3)
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 == y == z:
                xyz[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z - 1] = 1
            elif x != y and y != z and z != x:
                xyz[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z - 1] = 6
            else:
                xyz[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z - 1] = 3

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

Submission status: Wrong Answer

Solution code:
n = int(input())
xyz = [0] * ((10 ** 6) // 2 + 3)
for x in range(1, (10 ** 2) // 2 + 1):
    for y in range(1, (10 ** 2) // 2 + 1):
        for z in range(1, (10 ** 2) // 2 + 1):
            if x == y and y == z and z == x:
                xyz[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z - 1] = 1
            if x == y and y != z or x == z and y != z or y == z and x != y:
                xyz[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z - 1] = 3
            if x != y and y != z and x != z:
                xyz[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z - 1] = 6


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

Submission status: Wrong Answer

Solution code:
N=int(input())
x=1
y=1
z=1


for i in range(N):
    cnt=0
    for x in range(i):
        for y in range(i):
            for z in range(i):
                a=(x+1)**2+(y+1)**2+(z+1)**2+(x+1)*(y+1)+(y+1)*(z+1)+(z+1)*(x+1)
                if a==i:
                    cnt+=1
    print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0 for _ in range(n+1)]
for x in range(1,int(n**0.5)+1):
    for y in range(1,x+1):
        for z in range(1,y+1):
            if x**2+y**2+z**2+x*y+y*z+z*x<=n:
                if x==y==z:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 1
                if (x==y and y != z) or (y==z and z !=x) or (z==x and x != y):
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 3
                if (x!=y) and (y!=z) and (z!=x):
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 6
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0]*(N+1)
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            num = x*x + y*y + z*z + x*y + y*z + z*x
            if num>N:
                break
            ans[num] = ans[num] + 1
for m in ans:
    print(m)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0]*(N+1)
print(ans)
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            num = x*x + y*y + z*z + x*y + y*z + z*x
            if num>N:
                break
            ans[num] = ans[num] + 1
for m in ans:
    print(m)

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
import math

N=int(input())


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

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
l = []

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            fn = x**2 + y**2 + z**2 + x*y + y*z + z*x
            l.append(fn)

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
ans = defaultdict(int)
N = int(input())

for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            ans[i*i+j*j+k*k+i*j+j*k+k*i] += 1
for i in range(N):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
ans = defaultdict(int)
N = int(input())

for i in range(1, N):
    for j in range(1, N):
        for k in range(1, N):
            ans[i*i+j*j+k*k+i*j+j*k+k*i] += 1
for i in range(N):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
import sys
import math
N = int(sys.stdin.readline())

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

def calculate_f(n):
    f_num = 0
    for x in range(1,math.floor(math.sqrt(N))):
        for y in range(1,math.floor(math.sqrt(N))):
            for z in range(1,math.floor(math.sqrt(N))):
                calculated_n = calculate_n(x,y,z)
                if calculated_n > N:
                    break
                if calculate_n(x,y,z) == n:
#                     print('x:{0}, y:{1}, z:{2}'.format(x,y,z))
                    f_num += 1
    return f_num
                
for n in range(1,N):
    print(calculate_f(n))

Submission status: Wrong Answer

Solution code:
import sys
import math
N = int(sys.stdin.readline())

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

def calculate_f(n):
    f_num = 0
    for x in range(1,math.floor(math.sqrt(N))):
        for y in range(1,math.floor(math.sqrt(N))):
            for z in range(1,math.floor(math.sqrt(N))):
                if calculate_n(x,y,z) == n:
#                     print('x:{0}, y:{1}, z:{2}'.format(x,y,z))
                    f_num += 1
    return f_num
                
for n in range(1,N):
    print(calculate_f(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [0] * (n + 1)

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*z + y*z + x*z
      if a<= n:
        arr[a] += 1
        
for i in range(1,n+1):
    print(arr[i])

Submission status: Wrong Answer

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

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      i = x**2 + y**2 + z**2 + x*z + y*z + x*z
      if i <= n:
        a[i] += 1
        
for i in range(1,n+1):
    print(a[i])

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N = int(input())

ANS = [0] * (N+1)

for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            a = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if a <= N:
                ANS[a] += 1

for a in ANS:
    print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0 for _ in range(n+1)]
for i in range(1,n+1):
  if i*i>n:
    break
  for j in range(1,n+1):
    if i*i + j*j +i*j > n:
      break
    for k in range(1,n+1):
      tmp = i*i + j*j + k*k + i*j + j*k + k*i
      if tmp==n:
        a[tmp]+=1
      else:
        break
for i in range(1,n+1):
  print(a[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0 for _ in range(N + 1)]

for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      v = x * x + y * y + z * z  + x * y + y * z + z * x
      if v > N:
        continue
      ans[v] += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0 for _ in range(N + 1)]

for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      v = x * x + y * y + z * z  + x * y + y * z + z * x
      if v < N + 1:
        ans[v] += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0 for _ in range(N + 1)]

for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      v = x * x + y * y + z * z  + x * y + y * z + z * x
      if v < N:
        ans[v] += 1

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

Submission status: Wrong Answer

Solution code:
# x>=y>=zとしても対称性は失われない
# (式)>=x**2+2x+3 なのでx<= n**0.5
N = int(input())
ans = [0 for _ in range(N+1)]
print(ans)
for x in range(1,int(N**0.5)+1):
    for y in range(1,x+1):
        for z in range(1,y+1):
            if x**2+y**2+z**2+x*y+y*z+z*x <= N:
                if x == y == z:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 1
                if (x==y and x != z) or (y==z and y != x) or (z==x and z != y):
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 3
                if (x != y) and (y != z) and (z != x):
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 6
for answer in enumerate(ans[1:]):
    print(answer)

Submission status: Wrong Answer

Solution code:
# x>=y>=zとしても対称性は失われない
# (式)>=x**2+2x+3 なのでx<= n**0.5
N = int(input())
ans = [0 for _ in range(N+1)]
print(ans)
for x in range(1,int(N**0.5)+1):
    for y in range(1,x+1):
        for z in range(1,y+1):
            if x**2+y**2+z**2+x*y+y*z+z*x <= N:
                if x == y == z:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 1
                if (x==y and x != z) or (y==z and y != x) or (z==x and z != y):
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 3
                if (x != y) and (y != z) and (z != x):
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 6
            else:
                break
for answer in ans[1:]:
    print(answer)

Submission status: Wrong Answer

Solution code:
# x>=y>=zとしても対称性は失われない
# (式)>=x**2+2x+3 なのでx<= n**0.5
N = int(input())
ans = [0 for _ in range(N+1)]
print(ans)
for x in range(1,int(N**0.5)+1):
    for y in range(1,x+1):
        for z in range(1,y+1):
            if x**2+y**2+z**2+x*y+y*z+z*x <= N:
                if x == y == z:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 1
                if (x==y and x != z) or (y==z and y != x) or (z==x and z != x):
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 3
                if (x != y) and (y != z) and (z != x):
                    ans[x**2+y**2+z**2+x*y+y*z+z*x] += 6
            else:
                break
for answer in ans[1:]:
    print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = [0 for _ in range(10050)]

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            a = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if a < 10050:
                ans[a] += 1
for i in range(1,N):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
N = int(input())

x,y,z = 1,1,1

def is_true(x,y,z,i):
    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
        return True
    return False

loop = int(N ** (1/2))

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

for i in range(7,N+1):
    count = 0
    for a in range(loop):
        for b in range(loop):
            if a < b:
                break
            for c in range(loop):
                if b < c:
                    break
                X = x+a
                Y = y+b
                Z = z+c
                if is_true(X,Y,Z,i):
                    if X == Y == Z:
                        count += 1
                    elif X == Y or Y == Z or Z == X:
                        count += 3
                    else:
                        count += 6
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

x,y,z = 1,1,1

def is_true(x,y,z,i):
    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
        return True
    return False

loop = int(N ** (1/2))

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

for i in range(7,N+1):
    count = 0
    under = int((i/6) ** (1/2)) - 1
    for a in range(under,loop):
        for b in range(under,loop):
            if a < b:
                break
            for c in range(under,loop):
                if b < c:
                    break
                X = x+a
                Y = y+b
                Z = z+c
                if is_true(X,Y,Z,i):
                    if X == Y == Z:
                        count += 1
                    elif X == Y or Y == Z or Z == X:
                        count += 3
                    else:
                        count += 6
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

x,y,z = 1,1,1

def is_true(x,y,z,i):
    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
        return True
    return False

loop = int(N ** (1/2))

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

for i in range(7,N+1):
    count = 0
    under = int((i/6) ** (1/2)) - 1
    for a in range(under,loop):
        for b in range(under,loop):
            for c in range(under,loop):
                X = x+a
                Y = y+b
                Z = z+c
                if is_true(X,Y,Z,i):
                    count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

x,y,z = 1,1,1

def is_true(x,y,z,i):
    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
        return True
    return False

loop = int(N ** (1/2))

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

for i in range(7,N+1):
    count = 0
    for a in range(loop):
        for b in range(loop):
            for c in range(loop):
                X = x+a
                Y = y+b
                Z = z+c
                if is_true(X,Y,Z,i):
                    count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
t = int(input())
for i in range(t):
  if i < 6:
    print(0)
  else:
    tmp = i - 3
    num = 0
    for x in range(tmp):
      x += 1
      for y in range(tmp-x):
        y += 1
        for z in range(tmp-x-y):
          z += 1
          if i == x**2 + y**2 + z**2 + x*y + x*z + y*z:
            num += 1
    print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())

x,y,z = 1,1,1

def is_true(x,y,z,i):
    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
        return True
    return False

loop = int(N ** (1/2))
for i in range(1,N):
    count = 0

    if i < 6:
        print(count)
        continue
    for a in range(loop):
        for b in range(loop):
            for c in range(loop):
                X = x+a
                Y = y+b
                Z = z+c
                if is_true(X,Y,Z,i):
                    count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

x,y,z = 1,1,1

def is_true(x,y,z,i):
    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
        return True
    return False

loop = int(N ** (1/2))
for i in range(N):
    count = 0

    if i < 6:
        print(count)
        continue
    for a in range(loop):
        for b in range(loop):
            for c in range(loop):
                X = x+a
                Y = y+b
                Z = z+c
                if is_true(X,Y,Z,i):
                    count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1, 105):
  for j in range(1, 105):
    for k in range(1, 105):
      v = i * i + j * j + k * k + i * j + j * k + k * j
      if v < 10050:
        ans[v] += 1

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

Submission status: Wrong Answer

Solution code:
def triplets_brute(n):
    counter = 0
    upper = round(n**0.5)
    for x in range(1, upper+1):
        for y in range(1, upper+1):
            for z in range(1, upper+1):
                if x**2+y**2+z**2+x*y+y*z+z*x==n:
                    counter += 1
    return counter
print(triplets_brute(int(input())))

Submission status: Wrong Answer

Solution code:
def triplets_brute(n):
  counter = 0
  upper = round(n**0.5)
  for x in range(1, upper+1):
    for y in range(1, upper+1):
      for z in range(1, upper+1):
        if x**2+y**2+z**2+x*y+y*z+z*x==n:
          counter += 1
print(triplets_brute(int(input())))

Submission status: Wrong Answer

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

N = int(input())

A = [0]*100010

for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            A[foo(i,j,k)] += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0] * N
for i in range(1, 10):
    for j in range (1, 10):
        for k in range (1, 10):
            n = i**2 + j**2 + k**2 + (i*j) + (j*k) + (k*i)
            if n <= N:
                A[n - 1] = A[n - 1] + 1

for a in A:
    print(a)

Submission status: Wrong Answer

Solution code:
print

Submission status: Wrong Answer

Solution code:
n = int(input())

cnt = [0] * 10001

for i in range(1, 100):
	for j in range(1, 100):
		for k in range(1, 100):
			x = i*i + j*j + k*k + i*j + j*k + i*k
			if(x <= 1000):
				cnt[x]+=1

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

Submission status: Wrong Answer

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

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            num = x * x + y * y + z * z + x * y + y * z + z * x
            if num <= N:
                ans[num] = ans[num] + 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = list()

for i in range(N+1):
    ans.append(0)

for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if tmp < N:
                ans[tmp] += 1
for i in range(N):
    print(ans[i+1])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = list()

for i in range(N+1):
    ans.append(0)

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if tmp < N:
                ans[tmp] += 1
for i in range(N):
    print(ans[i+1])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = list()

for i in range(N+1):
    ans.append(0)

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = list()

for i in range(N):
    ans.append(0)

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n=int(input())
MAX=10001
RMAX=102
d = defaultdict(int)
for i in range(1,RMAX):
    wkx = i * 1
    if wkx > MAX:
        break
    for j in range(1,RMAX):
        wky = wkx + j * j  + i * j
        if wky > MAX :
            break
        for k in range(1,RMAX):
            wkz = wky + k * k + i * k  + j * k
            if wkz > MAX :
                break
            d[wkz] += 1
            
for i in range(n):
    k = i + 1
    print(d[k])

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n=int(input())
MAX=10000

d = defaultdict(int)

def col(x,y,z):
    if x == y and x == z  :
        return 1
    if x == y or y == z or z == x :
        return 3
    return 1     

# x <= y <= z
for i in range(1,MAX):
    wkx = i * i
    if wkx > MAX:
        break
    for j in range(i,MAX):
        wky = wkx + j * j  + i * j
        if wky > MAX :
            break
        for k in range(j,MAX):
            wkz = wky + k * k + i * k  + j * k
            if wkz > MAX :
                break
            d[wkz] = d[wkz] + col(i,j,k)
            
for i in range(n):
    k = i + 1
    print(d[k])

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n=int(input())
MAX=10000

d = defaultdict(int)

def col(x,y,z):
    if x == y and x == z  :
        return 1
    if x == y or y == z or z == x :
        return 3
    return 1     

# x <= y <= z
for i in range(1,MAX):
    wkx = i * 1
    if wkx > MAX:
        break
    for j in range(i,MAX):
        wky = wkx + j * j  + i * j
        if wky > MAX :
            break
        for k in range(j,MAX):
            wkz = wky + k * k + i * k  + j * k
            if wkz > MAX :
                break
            d[wkz] = d[wkz] + col(i,j,k)
            
for i in range(n):
    k = i + 1
    print(d[k])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i + j*j + k*k + k*j + i*k + i*j
            if v < 10050:
                ans[v] += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0 for _ in range(10050)]
for i in range(105):
    for j in range(105):
        for k in range(105):
            v = i*i + j*j + k*k + k*j + i*k + i*j
            if v < 10050:
                ans[v] += 1

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

Submission status: Wrong Answer

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

ans = [0]*(10**5)
for i1 in range(1, 40):
    i2 = i1+1
    i3 = i1+2
    if i3 > N:
        break
    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 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())
rootn = int(n**0.5) +1
ans = [0] * (n+1)
for x in range(1, rootn):
  for y in range(1, rootn):
    for z in range(1, rootn):
      cur = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if cur <= n:
        ans[cur] += 1
print('\n'.join(map(str, ans)))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
max = int(math.sqrt(n) + 1)
L = [0] * (n + 1)
for x in range(1, max):
    for y in range(1, max):
        for z in range(1, max):
            tmp = x * x + y * y + z * z + x * y + y * z + z * x
            if tmp > n:
                continue
            L[tmp] += 1

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
for i in range(5):
    print(0)
for n in range(6,N+1):
    ans = 0
    for q in range(2,int(math.sqrt(n-2))+1):
        for r in range(2,q+1):
            for p in range(q,q+r-1):
                if p**2+q**2+r**2==2*n:
                    if p==r:
                        ans += 1
                    elif p==q or q==r:
                        ans += 3
                    else:
                        ans += 6
    print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    ans = [0] * (6 * 10**4 + 10)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                ans[x**2 + y**2 + z**2 + x * y + y * z + x * z] += 1

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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


def log(*args):
    print(*args, file=sys.stderr)


def main():
    n = int(input().rstrip())
    ans = [0 for _ in range(n)]
    for x in range(1, 101):
        for y in range(x, 101):
            for z in range(y, 101):
                tmp = pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x
                if tmp > n:
                    continue
                if x == y == z:
                    ans[tmp - 1] = 1
                elif x == y or y == z or z == x:
                    ans[tmp - 1] = 3
                else:
                    ans[tmp - 1] = 6
    for v in ans:
        print(v)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def log(*args):
    print(*args, file=sys.stderr)


def main():
    n = int(input().rstrip())
    ans = [0 for _ in range(n)]
    for x in range(1, 100):
        for y in range(x, 100):
            for z in range(y, 100):
                tmp = pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x
                if tmp > n:
                    continue
                if x == y == z:
                    ans[tmp - 1] = 1
                elif x == y or y == z or z == x:
                    ans[tmp - 1] = 3
                else:
                    ans[tmp - 1] = 6
    for v in ans:
        print(v)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def log(*args):
    print(*args, file=sys.stderr)


def main():
    n = int(input().rstrip())
    ans = [0 for _ in range(n)]
    for x in range(1, 200):
        for y in range(x, 200):
            for z in range(y, 200):
                tmp = pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x
                log(tmp)
                if tmp > n:
                    break
                if x == y == z:
                    ans[tmp - 1] = 1
                elif x == y or y == z or z == x:
                    ans[tmp - 1] = 3
                else:
                    ans[tmp - 1] = 6
    for v in ans:
        print(v)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def log(*args):
    print(*args, file=sys.stderr)


def main():
    n = int(input().rstrip())
    ans = [0 for _ in range(n)]
    for x in range(1, 100):
        for y in range(x, 100):
            for z in range(y, 100):
                tmp = pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x
                log(tmp)
                if tmp > n:
                    break
                if x == y == z:
                    ans[tmp - 1] = 1
                elif x == y or y == z or z == x:
                    ans[tmp - 1] = 3
                else:
                    ans[tmp - 1] = 6
    for v in ans:
        print(v)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = [0 for _ in range(N+1)]
for x in range(1, 101):
    for y in range(x, 101):
        for z in range(y, 101):
            v = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if v < N:
                if x == y == z:
                    ans[v] += 1
                elif x == y or x == z or z == y:
                    ans[v] += 3
                else:
                    ans[v] += 6
for i in range(1,N+1):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
import math
num_limit = int(input())
s_limit_1 = int(num_limit**0.5)
s_limit_2 = int((num_limit/2)**0.5)
s_limit_3 = int((num_limit/3)**0.5)
for i in range(1,num_limit+1):
    xyz_list = []
    xyz_count = 0
    s_limit_1 = int(i ** 0.5)
    j = 0
    k = 0
    l = 0
    for j in range(1,s_limit_1+1):
        for k in range(1,j+1):
            if i <= j**2 + k**2 + l**2 + j*k + k*l + l*j:
                break
            for l in range(1,k+1):
                if i == j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    if j == k and k == l:
                        xyz_count += 1
                    elif j == k and k > l or j > k and k == l:
                        xyz_count += 3
                    else:
                        xyz_count += 6
                if i < j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    break
    print(xyz_count)