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

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
MAX_INT = 10**4+1
cumsum = [0] * (MAX_INT)

# 3~6
for i in range(3, 101):
  seen = []
  for n in range(1, i+1):
    for m in range(n, i+1):
      k = i - n - m
      if k <= 0: continue
      tmp = [n,m,k]
      tmp.sort()
      if tmp in seen: continue
      seen.append(tmp)

      p = i*i - (n*m + m*k + k*n)
      if p >= MAX_INT: break
      l = len(list(set(tmp)))
  
      if l==3:
        add = 6
      elif l==2:
        add = 3
      else:
        add = 1

      cumsum[p] += add
      
for i in range(1, N+1):
  print(cumsum[i])

Submission status: Wrong Answer

Solution code:
#C
n = int(input())

f = [0 for _ in range(10**5)]

for i in range(1,60):
    for j in range(1,60):
        for k in range(1,60):
            f[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1

for l in range(n):
    print(f[l+1])

Submission status: Wrong Answer

Solution code:
#C
n = int(input())

f = [0 for _ in range(10**5)]

for i in range(1,50):
    for j in range(1,50):
        for k in range(1,50):
            f[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1

for l in range(n):
    print(f[l+1])

Submission status: Wrong Answer

Solution code:
import itertools
from collections import defaultdict

def main():
    N = int(input())
    A = defaultdict(int)
    for x in range(1,N+1):
        breakflag = False
        for y in range(1,N+1):
            for z in range(1,N+1):
                a = x**2 + y**2 + z**2 + x*y + y*z + z*x
                # print(x,y,z,a,A)
                if a <= N:
                    A[a] += 1
                else:
                    break
    for i in range(N+1):
        print(A[i])

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np

N=int(input())

max=int(np.sqrt(N))
f=[0 for i in range(N)]

for x in range(1, max+1):
    for y in range(x, max+1):
        for z in range(y, max+1):
            fi=x**2 + y**2 + z**2 + x*y + y*z + z*x
            if fi<=N:
                if x!=y and y!=z and z!=x:
                    f[fi-1]=6
                elif x==y==z:
                    f[fi-1]=1
                else:
                    f[fi-1]=3

for j in range(N):
    print(f[j])

Submission status: Wrong Answer

Solution code:
ans = [0 for _ in range(10001)]
for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			w = x*x + y*y + z*z + x*y + y*z + z*x
			if w <= 10000:
				ans[w] += 1
print(*ans[1:int(input())], sep="\n")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
res = [0]*(n+1)
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 + k*i
            if x <= n:
                res[x] += 1
for i in range(1,n):
    print(res[i])

Submission status: Wrong Answer

Solution code:
N = int(input())

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

for i in ans:
    print(i)

Submission status: Wrong Answer

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

import math


def g(nx, ny, nz):
    return nx ** 2 + ny ** 2 + nz ** 2 + nx * ny + ny * nz + nz * nx


def solve(n):
    max_z = max(1, int(math.sqrt(n - 2) - 1) if n > 2 else 1)
    
    counter = [0 for _ in range(n + 1)]
    
    for z in range(1, max_z + 1):
        for y in range(1, z + 1):
            for x in range(1, y + 1):
                gn = g(x, y, z)
                if gn <= n:
                    counter[gn] += 3
    
    for x in range(int(math.sqrt(n) + 1)):
        nx = 6 * x ** 2
        if nx <= n:
            counter[nx] -= 2
    
    for i in range(1, n + 1):
        print(counter[i])


N = int(input())

solve(N)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

for i in ans:
    print(i)

Submission status: Wrong Answer

Solution code:
n = int(input())

ANS = [0] * (n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

for ans in ANS:
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

table = [0]*(10**4+100)

for x in range(1,42):
    for y in range(1,42):
        for z in range(1,42):
            total = x**2 + y**2 + z**2 + x*y + y*z + z*x
            table[total] += 1
            
for i in table[1:n+1]:
    print(i)

Submission status: Wrong Answer

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

import math


def g(nx, ny, nz):
    return nx ** 2 + ny ** 2 + nz ** 2 + nx * ny + ny * nz + nz * nx



def solve(n):
    max_z = max(1, int(math.sqrt(n - 2) - 1) if n > 2 else 1)
    
    counter = [0 for _ in range(n + 1)]
    
    for z in range(1, max_z + 1):
        for y in range(1, z + 1):
            for x in range(1, y + 1):
                gn = g(x, y, z)
                if gn <= n:
                    counter[gn] += 3
    
    for x in range(int(math.sqrt(n) + 1)):
        nx = 6 * x ** 2
        if nx <= n:
            counter[nx] -= 2
    
    for i in range(1, n + 1):
        print(counter[i])


N = int(input())

solve(N)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans =[0]*(N+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            s = x**2 + y**2 + z**2
            s += x*y + y*z + z*x
            if s > N:
                continue
            ans[s] += 1

for i in ans:
    print(i)

Submission status: Wrong Answer

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

import math


def g(nx, ny, nz):
    return nx ** 2 + ny ** 2 + nz ** 2 + nx * ny + ny * nz + nz * nx


def is_int(fn):
    return float(int(fn)) == float(fn)


def solve(n):
    min_z = max(1, int(math.sqrt(n) / 3))
    max_z = max(1, int(math.sqrt(n - 2) - 1) if n > 2 else 1)
    max_x = max(1, int(math.sqrt(n / 3) + 1))
    
    counter = [0 for _ in range(n + 1)]
    
    for z in range(max(1, min_z), max_z + 1):
        for y in range(1, z + 1):
            for x in range(1, min(y + 1, max_x)):
                gn = g(x, y, z)
                if gn <= n:
                    counter[gn] += 3
    
    for x in range(int(math.sqrt(n) + 1)):
        nx = 6 * x ** 2
        if nx <= n:
            counter[nx] -= 2
    
    for i in range(1, n + 1):
        print(counter[i])


N = int(input())

solve(N)

Submission status: Wrong Answer

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

import math


def g(nx, ny, nz):
    return nx ** 2 + ny ** 2 + nz ** 2 + nx * ny + ny * nz + nz * nx


def solve(n):
    min_z = max(1, int(math.sqrt(n) / 3))
    max_z = max(1, int(math.sqrt(n - 2) - 1) if n > 2 else 1)
    max_x = max(1, int(math.sqrt(n / 3) + 1))
    
    counter = [0 for _ in range(n + 1)]
    
    for z in range(max(1, min_z), max_z + 1):
        for y in range(1, z + 1):
            for x in range(1, min(y + 1, max_x + 1)):
                gn = g(x, y, z)
                if gn <= n:
                    counter[gn] += 3
    
    for x in range(int(math.sqrt(n) + 1)):
        nx = 6 * x ** 2
        if nx <= n:
            counter[nx] -= 2
    
    for i in range(1, n + 1):
        print(counter[i])


N = int(input())

solve(N)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = {}
for x in range(1, 50):
    for y in range(1, 50):
        for z in range(1, 50):
            tmp = x**2+y**2+z**2+x*y+x*z+y*z
            if not(tmp in ans):
                ans[tmp] = 1
            else:
                ans[tmp] += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = {}
for x in range(1, 42):
    for y in range(1, 42):
        for z in range(1, 42):
            tmp = x**2+y**2+z**2+x*y+x*z+y*z
            if not(tmp in ans):
                ans[tmp] = 1
            else:
                ans[tmp] += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = {}
for x in range(1, 42):
    for y in range(1, 42):
        for z in range(1, 42):
            tmp = x**2+y**2+z**2+x*y+x*z+y*z
            if not(tmp in ans):
                if x == y == z:
                    ans[tmp] = 1
                else:
                    ans[tmp] = 3

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
for i in range(n):
    k=0
    j=int(math.sqrt(i))
    for x in range(1,j+1):
        for y in range(1,j+1):
            for z in range(1,j+1):
                if x**2+y**2+z**2+x*y+y*z+z*x==i:
                    k+=1
    print(k)

Submission status: Wrong Answer

Solution code:
res = [0]*10001

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 < 10000:
                res[tmp] += 1

N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())
f = {}

for x in range(1, 110):
	for y in range(1, 110):
		for z in range(1, 110):
			t = x*x+y*y+z*z+x*y+y*z+z*x
			f[t] = (f[t]+1 if t in f.keys() else 1)

for i in range(1, N):
    print(f[i] if i in f.keys() else 0)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

ans = [0] * (N + 1)

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=[0]*(10001)
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      index=i**2+j**2+k**2+i*j+j*k+i*k
      if index<10000:
        ans[index]+=1
     
for i in range(1,n+1):
  print(ans[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,101):
			v=x**2 + y**2 + z**2 +x*y+y*x+x*z
			if v>n:
				break
			ans[v-1]+=1

print(*ans)

Submission status: Wrong Answer

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

for x in range(1,100):
	for y in range(1,100):
		for z in range(1,100):
			v=x**2 + y**2 + z**2 +x*y+y*x+x*z
			if v>n:
				break
			ans[v-1]+=1

print(*ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
from collections import defaultdict
ans = defaultdict(int)
for a in range(101):
  for b in range(101):
    for c in range(101):
      ans[a**2 + b**2 + c**2 + a*b + a*c + b*c] += 1
for n in range(1,N+1):
  print(ans[n])

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    d = [0 for _ in range(N)]
    rt = 100
    r = 41
    ii = 0
    for i in range(1,r ):
        ii += i + i - 1
        for j in range(i, 51):
            s = i + j
            iji = ii + s * j
            c = iji + (j + s - 1) * (j - 1)
            if iji + (s+j) * j > N:
                break
            for k in range(j, 100):
                c += s + k + k - 1
                if c <= N:
                    if i == j or j == k:
                        l = 3
                        if i == k:
                            l = 1
                    else:
                        l = 6
                    d[c - 1] += l
                    continue
                break
    print(*d, sep="\n")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    f = [0] * (N+1)
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                tmp = x*x + y*y + z*z + x*y + y*z + z*x - 1
                if tmp > N:
                    break
                f[tmp] += 1
    
    print("\n".join(map(str, f)))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
import collections
 
n = int(sys.stdin.readline().rstrip("\n"))
l = []
for a in range(1,43):
    for b in range(1,43):
        for c in range(1,43):
            l.append(a**2+b**2+c**2+a*b+b*c+c*a)
c = collections.Counter(l)
for i in range(1,n+1):
    print(c[i])

Submission status: Wrong Answer

Solution code:
import sys
import collections

n = int(sys.stdin.readline().rstrip("\n"))
l = []
for a in range(1,42):
    for b in range(1,42):
        for c in range(1,42):
            l.append(a**2+b**2+c**2+a*b+b*c+c*a)
c = collections.Counter(l)
for i in range(1,n+1):
    print(c[i])

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
ans1 = [0] * 10000
for i in range(1,100):
  for j in range(1,100):
    for k in range(1,100):
      ans = i**2 + j**2 +k**2 + i*j + j*k + k*i
      if(ans < 10000):
        ans1[ans] += 1
for i in range(n):
  print(ans1[i])

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
ar = [0 for i in range(n)]
r = int(math.sqrt(n))
for i in range(1,r+1):
    for j in range(1,r+1):
        for k in range(1,r+1):
            m = i ** 2 + j ** 2 + k ** 2 + i * j + i * k + j * k
            if m <= n:
                br = [i,j,k]
                if len(set(br)) == 1:
                    ar[m-1] = 1
                elif len(set(br)) == 2:
                    ar[m-1] = 3
                else:
                    ar[m-1] = 6
for r in ar:
    print(r)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
ans1 = [0] * n
for i in range(1,n):
  for j in range(1,n):
    for k in range(1,n):
      ans = i**2 + j**2 +k**2 + i*j + j*k + k*i
      for l in range(6,n-1):
        if(l+1 == ans):
          ans1[l] += 1
for i in range(n):
  print(ans1[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    ans=0
    for j in range(1,101):
        for k in range(1,101):
            if j * j + j * j + k * k + j * j + j * k + k * j == i+1:
                if j!=k:
                    ans += 3
                else:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

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

for i in range(1,math.ceil(math.sqrt(n))):
    for j in range(1,math.ceil(math.sqrt(n))):
        for k in range(1,math.ceil(math.sqrt(n))):
            v = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if(v < 10001):
                ans[v] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
answer_list = []
for x in range(1, 99, 1):
    for y in range(1, 99, 1):
        for z in range(1, 99, 1):
            formula = (x+y+z)**2 - (x*y + y*z + z*x)
            if formula >= n:
                continue
            else:
                answer_list.append(formula)
answer_list = sorted(answer_list)
for i in range(0, n+1, 1):
    print(answer_list.count(i))

Submission status: Wrong Answer

Solution code:
n = 20
answer_list = []
for x in range(1, 99, 1):
    for y in range(1, 99, 1):
        for z in range(1, 99, 1):
            formula = (x+y+z)**2 - (x*y + y*z + z*x)
            if formula >= n:
                continue
            else:
                answer_list.append(formula)
answer_list = sorted(answer_list)
for i in range(0, n, 1):
    print(answer_list.count(i))

Submission status: Wrong Answer

Solution code:
import numpy as np

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

n=int(input())

a=[ff(i,j,k) for i in range(1,42) for j in range(1,42) for k in range(1,42)]
an=np.array(a)

for i in range(1,n+1):
    print(np.count_nonzero(an==(i)))

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5)+1)),repeat=3):
    val = x*x + y*y + z*z + x*y + y*z + z*x
    if val <= N-1:
        lst[val-1] += 1
print(*lst,sep="\n")

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y +z*z + x*y + y*z + z*x
    if val <= N-1:
        lst[val-1] += 1
print(*lst,sep="\n")

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y +z*z + x*y + y*z + z*x
    if 0 <= val <= N-1:
        lst[val-1] += 1
print(*lst[1:],sep="\n")

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y +z*z + x*y + y*z + z*x
    if 0 <= val <= N:
        lst[val-1] += 1
print(*lst[1:],sep="\n")

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y +z*z + x*y + y*z + z*x
    if 6 <= val <= N:
        lst[val-1] += 1
print(*lst[1:],sep="\n")

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y +z*z + x*y + y*z + z*x
    if 6 <= val <= N:
        lst[val-1] += 1
print(lst[1:])

Submission status: Wrong Answer

Solution code:
def resolve():
    import sys
    sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
    to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
    print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

    # 入力を整数に変換して受け取る
    def input_int():
        return int(input())

    def map_int_input():
        return map(int, input())

    MII = map_int_input

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

    def MII_to_index():
        return map(to_index, input())

    def MII_split_to_index():
        return map(to_index, input().split())

    # 入力全てを整数に変換したものの配列を受け取る
    def list_int_inputs():
        return list(map(int, input()))

    LII = list_int_inputs

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

    # 2次元リスト化
    def LII_2D(rows_number):
        return [LII() for _ in range(rows_number)]

    def LII_split_2D(rows_number):
        return [LII_split() for _ in range(rows_number)]

    import math
    def L(x, y, z):
        return int(x * x + y * y + z * z + x * y + y * z + z * x)

    N = input_int()
    # for n in range(1, N + 1):  # f(n)を計算する仮定でf(n-1)の候補が現れるので...

    ans = [0 for _ in range(N)]
    for x in range(1, 105):
        for y in range(x, 105):
            for z in range(y, 105):
                f = L(x, y, z)
                
                if f <= N:
                    if x == y == z:
                        ans[f - 1] += 1
                    else:
                        ans[f - 1] += 3

    for a in ans:
        print(a)
resolve()

Submission status: Wrong Answer

Solution code:
# (x + y + z) ** 2 == n + xy + yz + zx\

ans = [0] * 10010
n = int(input())

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            value = x*x + y*y + z*z + x*y + y*z + z*x
            for i in range(1, n+1):
                if value == i:
                    ans[i] += 1

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

Submission status: Wrong Answer

Solution code:
def resolve():
    import sys
    sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
    to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
    print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

    # 入力を整数に変換して受け取る
    def input_int():
        return int(input())

    def map_int_input():
        return map(int, input())

    MII = map_int_input

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

    def MII_to_index():
        return map(to_index, input())

    def MII_split_to_index():
        return map(to_index, input().split())

    # 入力全てを整数に変換したものの配列を受け取る
    def list_int_inputs():
        return list(map(int, input()))

    LII = list_int_inputs

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

    # 2次元リスト化
    def LII_2D(rows_number):
        return [LII() for _ in range(rows_number)]

    def LII_split_2D(rows_number):
        return [LII_split() for _ in range(rows_number)]

    import math
    def L(x, y, z):
        return int(x * x + y * y + z * z + x * y + y * z + z * x)

    N = input_int()
    # for n in range(1, N + 1):  # f(n)を計算する仮定でf(n-1)の候補が現れるので...

    ans = [0 for _ in range(N)]
    for x in range(1, 100):
        for y in range(x, 100):
            for z in range(y, 100):
                f = L(x, y, z)
                if f <= N:

                    if z >= y:
                        if x == y == z:
                            ans[f-1] += 1
                        else:
                            ans[f-1] += 3

    for a in ans:
        print(a)
resolve()

Submission status: Wrong Answer

Solution code:
import sys


def resolve():
    import numpy as np

    readline = sys.stdin.readline

    N = int(readline())

    f = np.zeros(10001, np.int64)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                n = x * x + y * y + z * z + x * y + y * z + z * x
                if n >= 10000:
                    continue
                f[n] += 1
    for i in range(1, N + 1):
        print(f[i])

resolve()

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

def f(n):
  ans = 0
  limit = int(math.sqrt(n / 6)) + 2
  for x in range(1, limit + 1):
    for y in range(x, limit + 1):
      for z in range(y, limit + 1):
        A = x + y
        B = y + z
        C = z + x
        if A * A + B * B + C * C == n * 2:
          if x == y == z:
            ans += 1
          elif x == y or y == z:
            ans += 3
          else:
            ans += 6
  return 0

for i in range(1, n + 1):
  print(f(i))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
zeros = [0 for i in range(N+1)]
for x in range(1,int(math.sqrt(N))+1):
    for y in range(1,int(math.sqrt(N))+1):
        for z in range(1,int(math.sqrt(N))+1):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n < N:
                zeros[n]+=1

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
zeros = [0 for i in range(N+1)]
for x in range(1,int(math.sqrt(N))):
    for y in range(1,int(math.sqrt(N))):
        for z in range(1,int(math.sqrt(N))):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n < N:
                zeros[n]+=1

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

Submission status: Wrong Answer

Solution code:
n=int(input())
d={}
for i in range(1,100):
    for j in range(i,100):
        if i**2>n or j**2>n: break
        for k in range(j,100):
            tmp=i**2+j**2+k**2+i*j+j*k+k*i
            if tmp>n: break
            if i==k: x=1
            elif i==j or j==k: x=3
            else: x=6
            if tmp in d: d[tmp]+=x
            else: d[tmp]=x
for i in range(1,n+1):
    if i in d: print(d[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def sol():
    n=int(input())
 
    def col(n):
        ans=chk=0
        for i in range(1,n):
            if i**2>=n: break
            for j in range(1,n):
                if j**2>=n: break
                for k in range(1,n):
                    t = i**2+j**2+k**2+i*j+j*k+k*i
                    if k*k>n or t>n: break
                    ans+=1
        return ans
    for i in range(1,n+1):
        print(col(i))
 
if __name__=="__main__":
    sol()

Submission status: Wrong Answer

Solution code:
i=int(input())
if i==1: print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
cont = [0 for i in range(10050)]

for x in range(1,105):
  for y in range(1,105):
    for z in range(1,105):
      v = x**2 + y**2 + z**2 + z*x + y*z + x*y
      if v <= 10001:
        cont[v]+=1

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

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):
            v=x**2+y**2+z**2+x*y+y*z+z*x
            if v<10050:
                ans[v]+=1

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

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1,n+1):
    cnt = 0
    for j in range(1, 10^2+1): #x
        for k in range(1, 10^2+1): #y
            for l in range(1, 10^2+1): #z
                if j*j+k*k+l*l+j*k+k*l+l*j == i:
                      cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1,n+1):
    cnt = 0
    for j in range(1, 10^2): #x
        for k in range(1, 10^2): #y
            for l in range(1, 10^2): #z
                if j*j+k*k+l*l+j*k+k*l+l*j == i:
                      cnt += 1
    print(cnt)

Submission status: Wrong Answer

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

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

for i in l:
  print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())


for n in range(1,N+1):
    if n < 3:
        pass
    else:
        M =int((n-2)**0.5)
        count = 0
        for x in range(1,M+1):
            #P=x**2+y**2+z**2+x*y+y*z+z*x
            for y in range(1,M+1):
                #Q=x**2+y**2+z**2+x*y+y*z+z*x
                for z in range(1,M+1):
                    #R = x**2+y**2+z**2+x*y+y*z+z*x
                    if x**2+y**2+z**2+x*y+y*z+z*x == n:
                        count = count + 1
                    else:
                        pass
        print(count)

Submission status: Wrong Answer

Solution code:
import sys
import itertools as itr
readline = sys.stdin.buffer.readline



N=int(readline())
n=int(pow(N,0.5))-2
chk=list(itr.product(range(1,n),repeat=3))
cnt=[0]*(N+1)
for _ in range(len(chk)):
  i=chk[_][0]
  j=chk[_][1]
  k=chk[_][2]
  if pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i<=N:
    cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=1
          

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

Submission status: Wrong Answer

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


N=int(readline())
n=int(pow(N,0.5))+2
cnt=[0]*(N+1)
for i in range(1,n):  
  for j in range(i,n):
    for k in range(j,n):
      if pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i<=N:
        if i==j and j==k and k==i:
          cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=1
        else:
          cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=3
          

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

Submission status: Wrong Answer

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


N=int(readline())
n=int(pow(N,0.5))
cnt=[0]*(N+1)
for i in range(1,n):  
  for j in range(i,n):
    for k in range(j,n):
      if pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i<=N:
        if i==j and j==k and k==i:
          cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=1
        else:
          cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=3
          

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

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
for n in range(1,N+1):
    cnt = 0
    for x,y in itertools.product(list(range(1,n)),repeat=2):
        if x + y >= n: break
        z = n - x - y
        if z < 1: break
        if n == x*x + y*y +z*z + x*y + y*z + z*x:
            cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = [0]*(N+1)

for i in range(1, int(N**0.5)+1):
    for j in range(1, int(N**0.5)+2):
       for k in range(1, int(N**0.5)+2):
            f = i*i + j*j + k*k +i*j + j*k + k*i
            if f <= N:
                ans[f] += 1
print(len(ans))