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:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())

f_ = []
for x in range(1, 50):
    for y in range(x, 50):
        for z in range(y, 50):
            f_.append(x * x + y * y + z * z + x * y + y * z + x * z)

for i in range(1, N + 1):
    if i in f_:
        if i == 6:
            print(1)
        else:
            print(3)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

N = ri()
f = [0] * N
for x in range(1,100+1):
    for y in range(1, 100+1):
        for z in range(1, 100+1):
            h = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if h > N - 1:
                continue
            f[h - 1] += 1
for i in range(N):
    print(f[i])

Submission status: Wrong Answer

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
import numpy as np
# sympy as syp(素因数分解とか)
Mod = 1000000007
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1] 
for i in range(2, 10**5 + 1):
    fact.append((fact[-1] * i) % Mod)
    inv.append((-inv[Mod % i] * (Mod // i)) % Mod)
    factinv.append((factinv[-1] * inv[-1]) % Mod)
    
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % p
    
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[y] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)
import string
def main():  #startline-------------------------------------------
    n = int(input())
    ans = [0 for i in range(n)]
    print(ans)
    for i in range(1, int(np.sqrt(n + 1))):
        for j in range(1, int(np.sqrt(n + 1))):
            for k in range(1,int(np.sqrt(n + 1))):
                x = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
                if x <= n:
                    ans[x - 1] += 1
    for i in range(n):
        print(ans[i])
if __name__ == "__main__":
    main() #endline===============================================

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys
import math
import random
from decimal import Decimal
import itertools as it

N = int(input())
# for i in range(1,N+1):
f = [0 for i in range(N)]
# print(f)
for x in range(1, 51):
    x2 = x**2
    for y in range(1, 51):
        y2 = y**2
        for z in range(1, 51):
            a = x2+y2+z**2+x*y+y*z+x*z
            if a <= N:
                f[a-1] += 1
for i in f:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0 for i in range(10100)]
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 < 10000:
                ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

cnts = [0] * (n + 1)
for s in range(int(math.sqrt(n)) + 1 + 1):
  for x in range(1, s + 1):
    for y in range(1, s - x + 1):
      z = s - x - y
      if 1 <= z:
        f = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
        if 1 <= f <= n:
          cnts[f] += 1

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys
import math
import random
from decimal import Decimal
import itertools as it

N = int(input())
# for i in range(1,N+1):
f = [0 for i in range(N)]
# print(f)
for x in range(1, 51):
    x2 = x**2
    for y in range(1, 51):
        y2 = y**2
        for z in range(1, 51):
            a = x2+y2+z**2+x*y+y*z+x*z
            if a <= N:
                f[a-1] += 1
print(f)

Submission status: Wrong Answer

Solution code:
N = int(input())


d={}


for a in range(100):
	for b in range(100):
		z=(a+1)**2+(b+1)**2+(a+1)*(b+1)
		for c in range(100):
			gokei=z+(c+a+3+b)*(c+1)
			if gokei in d:
				d[gokei]+=1
			else:
				d[gokei]=1

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

Submission status: Wrong Answer

Solution code:
from math import sqrt

def f(n):
    count = 0
    for x in range(int(sqrt(n))):
        for y in range(int(sqrt(n))):
            for z in range(int(sqrt(n))):
                if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
                    count += 1
    print(count)

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

Submission status: Wrong Answer

Solution code:
N = int(input())
#A = list(map(int, input().split()))

ans = [0 for _ in range(N)]
for x in range(1, 151):
  for y in range(1, 151):
    for z in range(1, 151):
      k = (x+y)**2+(y+z)**2+(z+x)**2
      if k % 2 == 0 and k < 2*N:
        ans[((x+y)**2+(y+z)**2+(z+x)**2)//2-1] += 1

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import defaultdict


def main():
    n_in = int(input().strip())

    n_to_xyz = defaultdict(set)
    for x in range(1, 59):
        for y in range(1, 59):
            for z in range(1, 59):
                n = x * x + y * y + z * z + x * y + y * z + z * x
                n_to_xyz[n].add((x, y, z))

    for i in range(1, n_in + 1):
        print(len(n_to_xyz[i]))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]

N = rri()
# 
ans = [0 for i in range(N)]
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            if i*i + j*j+k*k+i*j+j*k+i*k<N:
                ans[i*i + j*j+k*k+i*j+j*k+i*k-1]+=1
for i in ans:
    print i

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

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

for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
for i in range(1,N+1):
    ans = 0
    for x in range(1,32):
        for y in range(1,32):
            for z in range(1,32):
                if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

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

for I in range(1, n+1):
    c = 0
    a = int(sqrt(I))
    for i in range(1, a-2-2*a):
        for j in range(1, a-2-2*a):
            for k in range(1, a-2-2*a):
                if i**2 + j**2 + k**2 + i*j + j*k + k*i == I:
                    c += 1
    print(c)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
#Nは6以上
for n in range(1,N):
    r_n = math.floor(math.sqrt(n))
    count = 0
    for x in range(1,r_n):
        for y in range(1,r_n):
            for z in range(1,r_n):
                if (x*x + y*y + z*z + x*y + y*z + z*x) == n:
                    count+=1
    print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0]*(n+1)
for x in range(1,20):
    for y in range(1,20):
        for z in range(1,20):
            ni = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if ni <= n:
                ans[ni] += 1
for i in range(1, n+1):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n = inn()
a = [0]*(n+1)
for x in range(1,72):
    for y in range(1,72):
        for z in range(1,72):
            v = x*x+y*y+z*z+x*y+x*z+y*z
            if v<=n:
                a[v] += 1
for i in range(1,n+1):
    print(a[i])

Submission status: Wrong Answer

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

N = ri()
f = [0] * N
for x in range(1,100+1):
    for y in range(1, 100+1):
        for z in range(1, 100+1):
            h = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if h > N - 1:
                continue
            tmp = len(set([x, y, z]))
            if tmp == 1:
                f[h - 1] += 1
            elif tmp == 2:
                f[h - 1] += 3
            else:
                f[h - 1] += 6
for i in range(N):
    print(f[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
N_list = [0]*(N+1)

for i in range(1,11):
    for j in range(1,11):
        for k in range(1,11):
           if(i**2+j**2+k**2+i*j+j*k+k*i<=N):
               N_list[i**2+j**2+k**2+i*j+j*k+k*i]+=1
for i in N_list[1:]:
    print(i)

Submission status: Wrong Answer

Solution code:
import numpy as np


def main(N):
    f = [0]*(N+1)
    for x in range(100):
        for y in range(100):
            for z in range(100):
                if (x+y+2)**2+(x+z+2)**2+(z+y+2)**2 > 2*N:
                    break
                f[((x+y+2)**2+(x+z+2)**2+(z+y+2)**2)//2] += 1
    return f


N = int(input())
f = main(N)
for num in f:
    print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())


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

res = defaultdict(int)

for x in range(1, 50):
  for y in range(1, 50):
    for z in range(1, 50):
      res[fun(x, y, z)] += 1
        
for n in range(1, N+1):
  print(res[n])

Submission status: Wrong Answer

Solution code:
from collections import defaultdict,deque
from sys import stdin,setrecursionlimit
import heapq,bisect,math,itertools,string,queue,copy
setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, stdin.readline().split()))

N = int(input())

d = [0]*(10**6 + 1)

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

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

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

L = [0] * (N + 1)
for x in range(1, N+1):
    for y in range(1, N + 1):
        for z in range(1, N + 1):
            if f(x,y,z) < N:
                L[f(x, y, z)] += 1
print(*L, sep="\n")

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    ans = [0]*(N+1)
    for x in range(1, N+1):
        if N < x**2:
            break
        for y in range(1, N+1):
            if N < x**2 + y**2 + x*y:
                break
            for z in range(1, N+1):
                if N < x**2 + y**2 + z**2 + x*y + y*z + z*x:
                    break
                ans[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def solve(n):
    li = [0] * (n ** 3 + 1)
    for x in range(1, n + 1):
        for y in range(1, n + 1):
            for z in range(1, n + 1):
                li[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1
    return li


N = int(input())
ans = solve(50)
[print(ans[i]) for i in range(1, N + 1)]

Submission status: Wrong Answer

Solution code:
N = int(input())
N_list = [0]*(N+1)

for i in range(1,11):
    for j in range(1,11):
        for k in range(1,11):
           if(i**2+j**2+k**2+i*j+j*k+k*i<=N):
               N_list[i**2+j**2+k**2+i*j+j*k+k*i]+=1
for i in N_list:
    print(i)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())


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

res = defaultdict(int)

for x in range(1, 50):
  for y in range(1, 50):
    for z in range(1, 50):
      res[fun(x, y, z)] += 1
        
for n in range(1, N):
  print(res[n])

Submission status: Wrong Answer

Solution code:
N = int(input())

F = [0]*(N+1)

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            c = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if (c <= N):
                F[c] += 1
print(*F, sep='\n')

Submission status: Wrong Answer

Solution code:
import collections
n = int(raw_input())
h = collections.Counter()
for x in range(n+1):
	for y in range(n+1):
		for z in range(n+1):
			q = x ** 2 + y ** 2 + z ** 2
			q += x*y + y*z + z * x
			if q > n:
				break
			h[q] +=1 
for i in range(n+1):
	print h[i]

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    res = [0]*(n+1)

    for i in range(1,33):
        for j in range(1,33):
            for k in range(1,33):
                if(i**2 + j**2 + k**2 + i*j + j*k + k*i<=n):
                    res[i**2 + j**2 + k**2 +i*j+j*k + k*i]+=1


    for i in range(1,n+1):
        print(res[i])
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
d=int(math.sqrt(N)+1)
bucket=[0 for i in range(N)]
for i in range(1,d+1):
  for j in range(1,d+1):
    for k in range(1,d+1):
      if(i**2+j**2+k**2<=2*N and (i**2+j**2+k**2)%2==0 and i+j-k>=2 and j+k-i>=2 and k+i-j>=2):
        bucket[(i**2+j**2+k**2)//2-1]+=1
for i in range(N):
  print(bucket[i])

Submission status: Wrong Answer

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

for p in range(1, n):
  right=math.floor(p*0.5)
  cnt=0
  for i in range(right):
    for j in range(right):
      for k in range(right):
        if i**2+j**2+k**2+i*j+j*k+k*i==p and i>0 and j>0 and k>0:
          cnt+=1
  print(cnt)

Submission status: Wrong Answer

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

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

N = int(input())

max_n = 70
ans = defaultdict(int)

for x in range(1, max_n):
    for y in range(1, max_n):
        for z in range(1, max_n):
            val = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if val <= N:
                # print(x, y, z, val)
                ans[val] += 1

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
for i in range(1, 6):
    print(0)
for i in range(6, n+1):
    x = int(math.sqrt(i)) + 1
    ans = 0
    for j in range(1, x):
        for f in range(1, x):
            for k in range(1, x):
                if (j + f + k) ** 2 - j*f - j*k - f*k == i:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

n = int(input())

d = defaultdict(int)

for i in range(1, 120):
    for j in range(1, 120):
        for k in range(1, 120):
            num = i**2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            d[num] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
fn = [0] * (10**5)

def f(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z+ z*x 
for x in range(1, 32):
    for y in range(1, 32):
        for z in range(1, 32):
            idx = f(x, y, z)
            fn[idx] += 1

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

Submission status: Wrong Answer

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

for n in range(1,N):
    r_n = math.floor(math.sqrt(N))
    count = 0
    for x in range(1,r_n):
        for y in range(1,r_n):
            for z in range(1,r_n):
                if (x*x + y*y + z*z + x*y + y*z + z*x) == n:
                    count+=1
    print(count)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
ans=[0 for i in range(N)]

for n in range(N):
    nax=int(math.sqrt(n))
    for x in range(1,nax):
        for y in range(1,x+1):
            for z in range(1,y+1):
                temp=x**2+y**2+z**2+x*y+y*z+z*x
                if temp==n+1:
                    ans[n]+=1

for anss in ans:
    print(anss*3)

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):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x - 1
            if n <= N:
                ans[n-1] += 1
for i in ans:
    print(i)

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = 0
list_N = [0]*n
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            d = pow(i, 2) + pow(j, 2) + pow(k, 2) +i*j + j*k + k*i
            if d <= n:
                list_N[d-1] += 1
            else:
                cnt = -1

            if cnt == 1:
                break
        if cnt == -1:
            break
    if cnt == -1:
        break

for i in list_N:
    print(i)

Submission status: Wrong Answer

Solution code:
import sys
from operator import itemgetter

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def iif(n): return [int(input()) for _ in range(n)]
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    mod = 1000000007
    
    N = ii()
    ans = [0] * N

    xyz = range(1, 101)
    for x in xyz:
        for y in xyz:
            for z in xyz:
                tmp = x*x + y*y + z*z + x*y + y*z + z*x
                if tmp < N:
                    ans[tmp-1] += 1
    
    print(*ans, sep="\n")

    return

main()

Submission status: Wrong Answer

Solution code:
f = [0]*10001
for x in range(1, 32):
    for y in range(1, 32):
        for z in range(1, 32):
            n = x*x + y*y + z*z + x*y + y*z + x*z
            if n < 10001:
                f[n] += 1
            else:
                break

N = int(input())
for n in range(1, N+1):
    print(f[n])

Submission status: Wrong Answer

Solution code:
import math

def main():
    n = int(input())
    _n = int(math.sqrt(n))
    ret = [0] * n
    for i in range(1, _n):
        for j in range(1, _n):
            for k in range(1, _n):
                tmp = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
                if tmp < n:
                    ret[tmp-1] += 1
                else:
                    break
    for i in range(n):
        print(ret[i])

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    res = [0]*(n+1)

    for i in range(1,33):
        for j in range(i,33):
            for k in range(j,33):
                if(i**2 + j**2 + k**2 +i*j+j*k + k*i<=n):
                    res[i**2 + j**2 + k**2 +i*j+j*k + k*i]+=3
                    if(i==j==k):
                        res[i**2 + j**2 + k**2 +i*j+j*k + k*i]-=2

    for i in range(1,n+1):
        print(res[i])
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

n = int(input())

d = defaultdict(int)

for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            num = i**2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            d[num] += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
d=int(math.sqrt(N)+1)
bucket=[0 for i in range(N)]
for i in range(d):
  for j in range(d):
    for k in range(d):
      if(i**2+j**2+k**2<=2*N and (i**2+j**2+k**2)%2==0 and i+j-k>=2 and j+k-i>=2 and k+i-j>=2):
        bucket[(i**2+j**2+k**2)//2-1]+=1
for i in range(N):
  print(bucket[i])

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
ctr = defaultdict(int)
for x in range(1, 50):
    for y in range(1, 50):
        for z in range(1, 50):
            res = x**2 + y**2 + z**2 + x*y + y*z + z*x
            ctr[res] += 1

for n in range(1, N + 1):
    print(ctr[n])

Submission status: Wrong Answer

Solution code:
n = int(input())
from itertools import product
l = list(range(1, 100+1))
f = [0 for _ in range(11000)]
def func(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
for x, y, z in product(l, l, l):
    v = func(x,y,z)
    if v <= n:
        f[v] += 1
for ans in f[:n+1]:
    print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
ctr = defaultdict(int)
for x in range(1, 42):
    for y in range(1, 42):
        for z in range(1, 42):
            res = x**2 + y**2 + z**2 + x*y + y*z + z*x
            ctr[res] += 1

for n in range(N + 1):
    print(ctr[n])

Submission status: Wrong Answer

Solution code:
N=int(input())

for i in range(N):
    n = int(i ** 0.5)
    count=0
    for x in range(1,n+1):
        for y in range(1,n+1):
            for z in range(1,n+1):
                if x**2+y**2+z**2+x*y+y*z+x*z==i:count+=1
    print(count)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain, product
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    N=ii()
    ans = [0]*(N+1)
    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 n<=N:
                    ans[n] += 1
    print(*ans)




main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    N=int(sys.stdin.readline())
    L=[0]*(10**4+1)
    for x in range(1,1000):
        for y in range(x,1000):
            for z in range(y,1000):
                r=x**2+y**2+z**2+x*y+y*z+z*x
                if r>10**4:
                    break
                
                c=len(set((x,y,z)))
                if c==3:
                    L[r]+=6
                elif c==2:
                    L[r]+=3
                elif c==1:
                    L[r]+=1


    for t in L[1:N]:
        print(t)
main()

Submission status: Wrong Answer

Solution code:
N=int(input())
for n in range(N):
    ans = 0
    for i in range(1,int((N**0.5)+1)):
        for j in range(1,int((N**0.5)+1)):
            for k in range(1,int((N**0.5)+1)):
                if i**2+j**2+k**2+i*j+j*k+k*i==n:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
n= int(input())
ans=[0]*(n+1)
v=10**2
for x in range(1,v+1):
    for y in range(1,v+1):
        for z in range(1,v+1):
            cnt=pow(x,2)+pow(y,2)+pow(z,2)+x*y+y*z+z*x
            if cnt<=n:
                ans[cnt]+=1

for i in ans:
    print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())

lst = [0] * 10001

for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      i  = x*x + y*y + z*z + x*y + y*z + z*x
      if i < 10000:
      	lst[i] += 1
      
for k in range(N):
  print(lst[k+1])

Submission status: Wrong Answer

Solution code:
import sys
import math
import bisect

def main():
    n = int(input())
    A = [0] * (n + 1)
    m = math.floor(math.sqrt(n))
    for x in range(1, m + 1):
        for y in range(1, m + 1):
            for z in range(1, m + 1):
                val = x*x + y*y + z*z + x*y + y*z + z*x
                if val >= 1 and val <= n:
                    A[val-1] += 1
    for i in range(1, n + 1):
        print(A[i])

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
from itertools import product
l = list(range(1, 100+1))
f = [0 for _ in range(11000)]
def func(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
for x, y, z in product(l, l, l):
    v = func(x,y,z)
    if v <= n:
        f[v] += 1
for ans in f[:n]:
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def f(a, b, c):
    return a**2 + b**2 + c**2 + a*b + b*c + c*a

ans = [0] * N

for x in range(1, 101):
    for y in range(x, 101):
        for z in range(y, 101):
            p = f(x, y, z)
            if (p <= N):
                if (x == y and y == z):
                    ans[p-1] = 1
                elif (x == y or y == z or z == x):
                    ans[p-1] = 3
                else:
                    ans[p-1] = 6

for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
res=[0]*(n+1)
for x in range(1,50):
  for y in range(1,50):
    for z in range(1,50):
      t = x**2+y**2+z**2+x*y+y*z+z*x
      if t > n:
        continue
      res[t]+=1
for i in range(1,n+1):
  print(res[i])