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:
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 0.5*((x+y)**2+(y+z)**2+(z+x)**2) <= 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:
from collections import Counter
N=int(input())
A=[]

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


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

Submission status: Wrong Answer

Solution code:
def INT():
    return int(input())

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

def LI():
    return list(map(int, input().split()))

N = INT()
ans = [0] * N

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

for n in range(1, N + 1):
    for x in range(1, 34):
        for y in range(1, 34):
            if fn(x, y, 1) > N:
                continue
            for z in range(1, 34):
                f = fn(x, y, z)
                if f == n and f <= N:
                    ans[f - 1] += 1

for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

for i in ret:
    print(i)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


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

Submission status: Wrong Answer

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


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


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


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


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


def main():
    N = readint()

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement

N = int(input())
ans = [0] * (N + 1)
for x, y, z in combinations_with_replacement(list(range(1, 50)), 3):
    val = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z

    n_diff = len(set([x, y, z]))
    if n_diff == 3:
        cnt = 6
    if n_diff == 2:
        cnt = 3
    if n_diff == 1:
        cnt = 1

    # print(val)
    
    if val <= N:
        ans[val] += cnt

print('\n'.join(map(str, ans[1:])))

Submission status: Wrong Answer

Solution code:
N = int(input())
anslist = [0] * (N + 1)
for x in range(1,100):
  for y in range(1,100):
    for z in range(1,100):
      temp = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if temp < N:
        anslist[temp] += 1

anslist.pop(0)

for i in anslist:
  print(i)

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    if n == 1:
        print(0)
        sys.exit()
    r = [0]*100000000
    for i1 in range(1,33):
        for i2 in range(1,33):
            for i3 in range(1,33):
                t = pow(i1, 2) + pow(i2, 2) + pow(i3, 2) + i1*i2 + i2*i3 + i1*i3
                t = int(t)
                r[t] += 1
    for i1 in range(1, n):
        print(r[i1])
    print(r[n], end='')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
for i in range(1, N+1):
    cnt = 0
    for x in range(1, int(math.pow(i, 1.0/3.0))):
        for y in range(1, int(math.pow(i, 1.0/3.0))):
            for z in range(1, int(math.pow(i, 1.0/3.0))):
                if ((x+y+z)**2)-x*y-y*z-z*x == i:
                    cnt += 1
    print(cnt)

Submission status: Wrong Answer

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

def func(n):
    cnt = 0
    for x in range(1, 20):
        for y in range(1, 20):
            for z in range(1, 20):
                if x * x + y * y + z * z + x * y + y * z + z * x == n:
                    cnt += 1
    return cnt


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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
import numpy as np
rn=n**0.5
for ii in range(n):
  r=0
  for xx in np.arange(1,rn+1):
    for yy in np.arange(1,xx+1):
      for zz in np.arange(1,yy+1):
        if xx**2+yy**2+zz**2+xx*yy+xx*zz+yy*zz==n:
          r+=1
  print(r)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=int(N**(0.34)//1)
for a in range (1,n+2):
    for b in range(1,n+2):
        for c in range(1,n+2):
            s.append(a*a+b*b+c*c+a*b+b*c+c*a)
s.sort()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 幅優先探索（行きがけ）
import collections
import sys
import math


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N = I()
    if N <= 5:
        for i in range(N):
            print(0)
        return

    def yy(x, y, z):
        x = int(x)
        y = int(y)
        z = int(z)
        return x**2+y**2+z**2+x*y+y*z+z*x

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

    for i in range(6, N+1):
        cn = 0
        for j in range(1, math.floor(math.sqrt(i)+1)):
            for k in range(1, math.floor(math.sqrt(j)+1)):
                for l in range(1, math.floor(math.sqrt(k)+1)):
                    y = yy(str(j), str(k), str(l))
                    if y == i:
                        if j == k == l:
                            cn += 1
                        elif j != k != l:
                            cn += 6
                        else:
                            cn += 3
        print(cn)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

num_m = (N-4)//2

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


print(*ans, sep="\n")

Submission status: Wrong Answer

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

n = int(input())
for i in range(1, n+1):
    print(func(i))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = 8
for n in range(1, N+1):
    num = 0
    for i in range(1, A):
        for j in range(1, A):
            for k in range(1, A):
                if math.pow(i + j + k, 2) == (i * j + j * k + k * i) + n:
                    num += 1
    print(num)

Submission status: Wrong Answer

Solution code:
import sys

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

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

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

N = int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
mul=1
while ans<=N:
    ans=6*(mul**2)
    mul+=1
ANS={}
for i in range(1,mul+1):
    for j in range(i,mul+1):
        for k in range(j,mul+1):
            if i!=j and j!=k and k!=i:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=6
            elif i==j and j==k:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=1
            else:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=3
for i in range(1,N+1):
    if i in ANS.keys():
        print(ANS[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
from itertools import product

N = int(input())

cnt = [0]*100000000

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

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

Submission status: Wrong Answer

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


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


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


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


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


def main():
    N = readint()

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [0] * n
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n_ = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n_ > n:
                break
            
            l = len({x, y, z})
            if l == 1:
                tmp = 1
            elif l == 2:
                tmp = 3
            else:
                tmp = 6
            arr[n_-1] = tmp
        if x**2 + y**2 + z**2 + x*y + y*z + z*x > n:
            break

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

Submission status: Wrong Answer

Solution code:
N = int(input())
import itertools
num = [i for i in range(1,42)]
comb = list(itertools.combinations_with_replacement(num, 3))
cnt_list = [0] * 10001
for c in comb:
    x = c[0]
    y = c[1]
    z = c[2]
    n = x**2 + y**2 + z**2 + x*y + y*z + z*x
    if n <= 10000:
        if x == y and y == z and z == x:
            cnt_list[n] += 1
        elif x == y or y == z or z == x:
            cnt_list[n] += 3
        else:
            cnt_list[n] += 6
for i in range(1,N+1):
    print(cnt_list[i])

Submission status: Wrong Answer

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


def main():
    N = int(input())
    ans = [0] * 11 ** 6
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                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
    squares = [print(i) for i in ans[0 : N]]

                    
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = 5
for n in range(1, N+1):
    num = 0
    for i in range(1, A):
        for j in range(1, A):
            for k in range(1, A):
                if math.pow(i + j + k, 2) == (i * j + j * k + k * i) + n:
                    num += 1
    print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
record = [0] * 1000000

for i in range(1,N+1):
    for j in range(1,N+1):
        sum = i**2 + i**2 + j**2 + i*i + i*j +j*i
        if sum >= N: break
        # print(i,j)
        if i==j: record[sum] += 1
        else: record[sum] += 3


for num in record[1:N+1]:
    print(num)

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

import math
for a in range(1, N+1):
    n = 0
    top = int(math.sqrt(a)/3)+1
    for b in range(1, top):
        for c in range(1, top):
            for d in range(1, top):
                if (b**2) + (c**2) + (d**2) + (b*c) + (c*d) + (d*b) == a:
                    n += 1
    print(n)

Submission status: Wrong Answer

Solution code:
from collections import Counter
from itertools import combinations_with_replacement
N = int(input())
L = [i for i in range(1, 50)]
ans = []
for c in combinations_with_replacement(L, 3):
    x = c[0]
    y = c[1]
    z = c[2]
    tmp = x**2+y**2+z**2+x*y+y*z+z*x
    ans.append(tmp)
C = Counter(ans)
for i in range(1, N+1):
    if C[i]:
        print(C[i]*3)
    else:
        print(0)

Submission status: Wrong Answer

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

def func(n):
    cnt = 0
    N = min(n, 18)
    for x in range(1, N):
        for y in range(1, N):
            for z in range(1, N):
                if x * x + y * y + z * z + x * y + y * z + z * x == n:
                    cnt += 1
    return cnt


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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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


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())
ans = [0 for i in range(n)]

for i in range(1,n+1):
  for x in range(1,33):
    for y in range(1,33):
      for z in range(1,33):
        if x**2+y**2+z**2+x*y+y*z+z*x == i:
          
          ans[i-1]+=1
          
for i in ans:
  print(i)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
s=[]
n=int(N**(0.34)//1)
for a in range (1,n+1):
    for b in range(1,n+1):
        for c in range(1,n+1):
            s.append(a*a+b*b+c*c+a*b+b*c+c*a)
s.sort()

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = [0 for i in range(n)]
for i in range(1,105):
    for j in range(i,105):
        for k in range(j,105):
            if i*i + j*j + k*k + i*j + k*j + i*k > n:
                break
            if i == j and j==k:
                ans[i*i + j*j + k*k + i*j + k*j + i*k-1] = 1
            elif i == j or j==k or k==i:
                ans[i*i + j*j + k*k + i*j + k*j + i*k-1] = 3
            else:
                ans[i*i + j*j + k*k + i*j + k*j + i*k-1] = 6

print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

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

for i in range(n):
  count = 0

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

  print(count)

Submission status: Wrong Answer

Solution code:
import itertools
import pprint

n = int(input())

result = [0]*15000
maxnum = 50
xlist, ylist, zlist = range(1, maxnum), range(1, maxnum), range(1, maxnum)
p = itertools.product(xlist, ylist, zlist)
for each in p:
    x, y, z = each
    result[x*x+y*y+z*z+x*y+y*z+z*x] += 1

print('\n'.join(str(each) for each in result[1:n+1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n + 1):
    ans = 0
    for x in range(1, 4):
        for y in range(1, 4):
            for z in range(1, 4):
                p = x**2 + y**2 + z**2 + x * y + y * z + z * x
                if p > n:
                    break
                if p == i:
                    ans += 1
    print(ans, flush=False)

Submission status: Wrong Answer

Solution code:
import itertools

N=int(input())
L=[0]*(10**4+10)
X=[x for x in range(1,12)]
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+y+z)**2-x*y-x*z-z*x]+=plus[temp]

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
arr = [0]*N
rtN = int(math.sqrt(N))*2
for x in range(rtN)[1:]:
    for y in range(rtN)[x:]:
        for z in range(rtN)[y:]:
            r = (x+y+z)**2-(x*y+y*z+z*x)
            if r < N:
                if (x==z):
                    arr[r-1] +=1
                elif(x==y or y==z):
                    arr[r-1] +=3
                else:
                    arr[r-1] +=6
for ar in arr:
	print(ar)

Submission status: Wrong Answer

Solution code:
import sys


def f(i):
    ans = 0
    for x in range(1, 33):
        for y in range(x, 33):
            for z in range(y, 33):
                n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if i == n:
                    a = len(set((x, y, z)))
                    if a == 1:
                        ans += 1
                    elif a == 2:
                        ans += 3
                    elif a == 3:
                        ans += 6
                    break
                elif i < n:
                    break

    return ans

def resolve(in_):
    n = int(in_.readline())
    for i in range(1, n):
        yield f(i)



def main():
    for answer in resolve(sys.stdin.buffer):
        print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
  if i < 6:
    print(0)
  else:
    count=0
    for j in range(100):
      for k in range(100):
        for l in range(100):
          if ((j+1)**2 + (k+1)**2 + (l+1)**2 + (j+1)*(k+1) +(k+1)*(l+1) +(l+1)*(j+1)) == i:
            count +=1
    print(count)

Submission status: Wrong Answer

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


n = int(input())

ind = {_: 0 for _ in range(1, 10**4 + 1)}
cnt = 0
for i in range(1, 10**4 + 1):
    if fx(i, 1, 1) > 10 ** 4:
        break
    for j in range(1, 10 ** 4 + 1):
        if fx(1, j, 1) > 10 ** 4:
            break
        for k in range(1, 10 ** 4 + 1):
            if fx(i, j, k) < 10 ** 4:
                ind[fx(i, j, k)] += 1
            else:
                break

for num in range(1, n + 1):
    print(ind[num])

Submission status: Wrong Answer

Solution code:
import itertools
import math
N = int(input())
n = int(math.sqrt(N/6))+1
atai = []
for num in range(1,n+1):
  atai += [num]
  
xyz = list(itertools.product(atai,repeat = 3))
print(xyz)
for num in range(1,N+1):
  count = 0
  test = 0
  for i in range(len(xyz)):
    test = (xyz[i][0]*xyz[i][0]+xyz[i][1]*xyz[i][1]+xyz[i][2]*xyz[i][2]+xyz[i][0]*xyz[i][1]+xyz[i][0]*xyz[i][2]+xyz[i][1]*xyz[i][2])
    if(test == num):
      count += 1
  print(count)

Submission status: Wrong Answer

Solution code:
def val():
    an = (a[0]**2)+(a[1]**2)+(a[2]**2)
    an += (a[0]*a[1])+(a[0]*a[2])+(a[1]*a[2])
    return an

n=int(input())
a=[1,1,1]
ans = {}
ans[6] = 1
for i in range(2,n+1):
    for j in range(3):
        a[j] = i
        temp = val()
        if temp>n:
            break
        if temp not in ans:
            ans[temp]=0
        if j==2:
            ans[temp]+=1
        else:
            ans[temp]+=3
    a=[1,1,1]

for i in range(1,n+1):
    if i not in ans:
        print(0)
    else:
        print(ans[i])

Submission status: Wrong Answer

Solution code:
x,y,z = 1,1,1
import math
lar_num = int(input())
answer = 0
#最小でn=6で存在
for i in range(1,lar_num + 1):
    if i <= 6:
        answer = 0
        print(answer)
    else:
        maxnum = math.ceil(-1+(i-2)**0.5)
        for x in range(1,maxnum+1):
            for y in range(1,maxnum+1):
                for z in range(1,maxnum+1):
                    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
                        answer += 1
        print(answer)
        answer = 0

Submission status: Wrong Answer

Solution code:
n = int(input())

rng = [0] * (n+1)

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

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

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ls=[0]*n
x=1
y=1
z=1
p=6
m=int(n**0.5)
for x in range(1,m+3):
  for y in range(1,x+1):
    for z in range(1,y+1):
      k=3
      if x==y and x==z:
        k=1
      j=x*x+y*y+z*z+x*y+y*z+x*z
      if j<=n:
        ls[j-1]+=k
      else:
        break
for i in ls:
  print(i)

Submission status: Wrong Answer

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


def main():
    N = int(input())
    ans = [0] * 10 ** 6
    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 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
    squares = [print(i) for i in ans[0 :N]]

                    
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import itertools
import math

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

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

def f(n):
    result = [0] * (n+1)
    for idx, (x, y, z) in enumerate(itertools.product("".join(map(str, (range(1, saidai + 1)))), repeat=3)):
        tmp = g(int(x), int(y), int(z))
        if tmp <= N:
            result[tmp] += 1
    return result

res = f(N)
for i in range(1, N+1):
    print(res[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
num = [0] * 10001
for i in range(1, 142):
    for j in range(1, 142):
        for k in range(1, 142):
            temp = i + j + k
            if temp % 2 == 0:
                if i + j > k and j + k > i and k + i > j:
                    temp2 = (i ** 2 + j ** 2 + k ** 2) // 2
                    if 0 <= temp2 <= 1000:
                        num[temp2] += 1
for i in range(1, n + 1):
    print(num[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
record = [0] * 1000000

for i in range(1,N+1):
    for j in range(1,N+1):
        sum = i**2 + i**2 + j**2 + i*i + i*j +j*i
        if sum >= N: break
        # print(i,j)
        record[sum] += 3

for num in record[1:N+1]:
    print(num)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [0] * 10010

# x,y,z
for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      if x*x + y*y + z*z + x*y + y*z + z*x > n:
        continue
      a[x*x + y*y + z*z + x*y + y*z + z*x] += 1


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

Submission status: Wrong Answer

Solution code:
n=int(input())
ls=[0]*n
x=1
y=1
z=1
p=6
m=int(n**0.5)
for x in range(1,m):
  for y in range(1,x+1):
    for z in range(1,y+1):
      k=3
      if x==y and x==z:
        k=1
      j=x*x+y*y+z*z+x*y+y*z+x*z
      if j<=n:
        ls[j-1]+=k
      else:
        break
for i in ls:
  print(i)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
for i in range(1, N+1):
    cnt = 0
    if i < 6:
        print(0)
    for x in range(1, int(math.sqrt(i))):
        for y in range(1, int(math.sqrt(i))):
            for z in range(1, int(math.sqrt(i))):
                if ((x+y+z)**2)-x*y-y*z-z*x == i:
                    cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
arr = [0]*N
rtN = int(math.sqrt(N))+10
for x in range(rtN)[1:]:
    for y in range(rtN)[x:]:
        for z in range(rtN)[y:]:
            r = (x+y+z)**2-(x*y+y*z+z*x)
            if r < N:
                if (x==z):
                    arr[r-1] +=1
                elif(x==y or y==z):
                    arr[r-1] +=3
                else:
                    arr[r-1] +=6
for ar in arr:
	print(ar)