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: Accepted

Solution code:
"""
    Satwik_Tiwari ;) .
    12th july , 2020  - Sunday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

from itertools import *
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def f(x,y,z):
    return ((x**2)+(y**2)+(z**2)+(x*y)+(x*z)+(y*z))

def solve():
    n = int(inp())
    # print(arr[1:21])

    arr = [0]*(n+1+1)
    for i in range(1,101):
        for j in range(1,101):
            for k in range(1,101):
                # print(f(i,j,k))
                if(f(i,j,k) <= n):
                    arr[f(i,j,k)] +=1
                else:
                    break
    for i in range(n):
        print(arr[i+1])

testcase(1)
# testcase(int(inp()))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N=int(input())

#f(N)を入れるリスト。f(1)=ans_list[0], f(N)=ans_list[N-1]
ans_list=[0]*N

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            s=x**2+y**2+z**2+x*y+y*z+z*x
            if s<=N:
                ans_list[s-1]+=1
            
   
for i in range(N):
   print(ans_list[i])

Submission status: Accepted

Solution code:
import math

n = int(input())
nn = int(math.sqrt(n))+1

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

for a in ans:
    print(a)

Submission status: Accepted

Solution code:
import sys,collections; input = lambda : sys.stdin.readline()
exec("try:sys.stdin=pen('input.txt','r')\nexcept:pass")
n = int(input())
ans = [0]*100005
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 < 100005:
                ans[v] += 1
for i in range(n):
    print(ans[i+1])

Submission status: Accepted

Solution code:
N = int(input())

result = [0]*(N+1)

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

Submission status: Accepted

Solution code:
n = int(input())
rates = [1,1,3,6]
cnt = [0]*10001
def g(x,y,z):
    return x**2 + y**2 + z**2 + x*y + x*z + y*z

for x in range(1,101):
    for y in range(x,101):
        for z in range(y,101):
            rate = rates[len(set([x,y,z]))]
            gv = g(x,y,z)
            if gv < 10001:
                cnt[gv]+=rate
for i in range(1,n+1):
    print(cnt[i])

Submission status: Accepted

Solution code:
import math
n = int(input())
t = [0] * (n + 1)
m = math.floor(math.sqrt(n))

for i in range(1,m):
    for j in range(1,m):
        for k in range(1,m):
            p = i*i+j*j+k*k+i*j+j*k+i*k
            if p <= n:
                t[p] += 1

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

Submission status: Accepted

Solution code:
N = int(input())

ans = [0] * (N+1)
for a in range(1, 105):
  if a*a > N :
    break
  for b in range(1, 105):
    if a*a + b*b > N:
      break      
    for c in range(1, 105):
      if a*a + b*b + c*c + a*b + b*c + c*a > N:
        break
      ans[a*a + b*b + c*c + a*b + b*c + c*a] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    ans = [0]*(N)
    for x in range(1, 105):
        for y in range(1, 105):
            for z in range(1, 105):
                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] += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())

lst = [0]*100000

for i in range(1, 101):
  for j in range(1, 101):
    for k in range(1, 101):
      m = i**2 + j**2 + k**2 + i*j + j*k + k*i
      lst[m] += 1
      
for i in range(1, n+1):
  print(lst[i])

Submission status: Accepted

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

Submission status: Accepted

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

d = defaultdict(int)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def cal(i,j,k):
    a = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i 
    return a

N = int(input())
ans = [0] * (N + 1)
m = int(N ** 0.5)
for i in range(1,m):
    for j in range(1,m):
        for k in range(1,m):
            if cal(i,j,k) <= N:
                ans[cal(i,j,k)] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
ans=[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
            tmp+=x*y+y*z+z*x
            if tmp<=N:
                ans[tmp]+=1
                
for i in range(1,N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n = int(input())
A = [0]*(n+1)
 
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <= n:
                A[a] += 1
            else:
                break
            
                
for i in range(n):
    print(A[i+1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num_limit = int(input())
num_list = [0] * num_limit
j_limit = int(num_limit ** 0.5)
for j in range(1,j_limit+1):
    for k in range(1,j + 1):
        if num_limit < j**2 + k**2 + j*k:
            break
        for l in range(1,k+1):
            if num_limit < j**2 + k**2 + l**2 + j*k + k*l + l*j:
                break
            elif num_limit >= j**2 + k**2 + l**2 + j*k + k*l + l*j:
                if j > k:
                    if k > l:
                        num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 6
                    else:
                        num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 3
                elif k > l:
                    num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 3
                else:
                    num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 1
for i in num_list:
    print(i)

Submission status: Accepted

Solution code:
num_limit = int(input())
num_list = [0] * num_limit
j_limit = int(num_limit ** 0.5)
for j in range(1,j_limit+1):
    for k in range(1,j + 1):
        for l in range(1,k+1):
            if num_limit >= j**2 + k**2 + l**2 + j*k + k*l + l*j:
                if j > k:
                    if k > l:
                        num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 6
                    else:
                        num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 3
                elif k > l:
                    num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 3
                else:
                    num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 1
for i in num_list:
    print(i)

Submission status: Accepted

Solution code:
N = int(input())

keys = [i for i in range(1, N+1)]
values = [0] * N
count_dict = dict(zip(keys, values))

for x in range(1, 110):
    for y in range(x, 110):
        for z in range(y, 110):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n > N:
                break
            if x == y and y == z:
                count_dict[n] += 1
            elif x != y and x != z and y != z:
                count_dict[n] += 6
            else:
                count_dict[n] += 3

for v in count_dict.values():
    print(v)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = [0]*10050
 
for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <10050:
                A[a] += 1
                
for i in range(n):
    print(A[i+1])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# モジュールのインポート
import math
import itertools


def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N

# メイン処理


def g(x: int, y: int, z: int) -> int:
    """
    関数.

    Args:\n
        x (int): 整数（1 <= x）
        y (int): 整数（1 <= y）
        z (int): 整数（1 <= z）

    Returns:\n
        int: 関数値
    """
    return x**2 + y**2 + z**2 + x*y + y*z + z*x


def main(N: int) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 整数
    """
    # 求解処理
    l = [0 for n in range(N)]
    ub = int(math.sqrt(N))
    for x, y, z in itertools.product(range(1, ub + 1), repeat=3):
        v = g(x, y, z)
        if v <= N:
            l[v - 1] += 1

    # 結果出力
    for ans in l:
        print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N = get_input()

    # メイン処理
    main(N)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# モジュールのインポート
import math
import itertools

# 標準入力を取得
N = int(input())

# メイン処理


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


l = [0 for n in range(N)]
for x, y, z in itertools.product(range(1, int(math.sqrt(N)) + 1), repeat=3):
    v = g(x, y, z)
    if v <= N:
        l[v - 1] += 1

# 結果出力
for ans in l:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = [0] * (N+1)
for a in range(1, 105):
  if a*a > N :
    continue
  for b in range(1, 105):
    if a*a + b*b > N:
      continue      
    for c in range(1, 105):
      if a*a + b*b + c*c + a*b + b*c + c*a > N:
        continue
      ans[a*a + b*b + c*c + a*b + b*c + c*a] += 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i
            if v < 10001:
                ans[v]+=1

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

Submission status: Accepted

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

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

current = [1,1,1]
ans = 0
p = [0 for _ in range(n+1)]
m = math.ceil(math.sqrt(n))+1
for i in range(1, m):
  f_ = f(i, 1, 1)
  if f_ > n:
    break
  for j in range(1, m):
    f_ = f(i,j,1)
    if f_ > n:
      break
    for k in range(1, m):
      f_ = f(i,j,k)
      if f_ > n:
        break
      p[f_] += 1
for i in range(1, n+1):
  print(p[i])

Submission status: Accepted

Solution code:
n = int(input())
rootn = int(n**0.5) +1
ans = [0] * (n+1)
for x in range(1, rootn):
  for y in range(1, rootn):
    for z in range(1, rootn):
      cur = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if cur <= n:
        ans[cur] += 1
print('\n'.join(map(str, ans[1:])))

Submission status: Accepted

Solution code:
n=int(input())
MAX=(10**4)
cntl=[0]*(MAX+1)

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+x*z>MAX:
        break
      cntl[x**2+y**2+z**2+x*y+y*z+x*z]+=1
for i in range(1,n+1):
  print(cntl[i])

Submission status: Accepted

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

ans = [0]*N

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


for x in range(1,int(math.sqrt(N))+10):
    for y in range(1,int(math.sqrt(N))+10):
        for z in range(1,int(math.sqrt(N))+10):
            if g(x,y,z) <= N:
                ans[g(x,y,z)-1] += 1

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
n=int(input())
l=[0]*n
q=int(n**0.5)
for i in range(1,q+1):
  for j in range(1,q+1):
    for k in range(1,q+1):
      t=((i+j)**2+(j+k)**2+(i+k)**2)//2
      if t<=n:
        l[t-1]+=1
print(*l)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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*i + j*j + k*k + i*j + i*k + j*k
            if v<10050:
                ans[v]+=1
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n=(int)(input())
a=[0 for i in range(10001)]
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      temp = (x * x) + (x * y) + (x * z) + (y * y) + (y * z) + (z * z)
      if temp <= 10000:
        a[temp] += 1

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(10**4+1)]
for x in range(1, 101): #x
    for y in range(1, 101): #y
        for z in range(1,101): #z
            if (m:=x*x+y*y+z*z+x*y+y*z+z*x) <= n:
                # print(m)
                ans[m] += 1

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(300000)
from math import sqrt, ceil
from collections import defaultdict

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N = I()

n = ceil(sqrt(N))
d = defaultdict(int)
for x in range(1, n + 1):
    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
            if a <= N:
                d[a] += 1
for i in range(1, N + 1):
    print(d[i])

Submission status: Accepted

Solution code:
n = int(input())
f = [0]*100000005
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            x = i**2 + j**2 + k**2 + i*j + j*k+ k*i
            f[x] += 1

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

Submission status: Accepted

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


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

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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


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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
l = [0] * 10 ** 5
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            n = (pow(x + y,2) + pow(y + z,2) + pow(z + x,2)) // 2
            l[n] += 1
for n in range(1,N + 1):
    print(l[n])

Submission status: Accepted

Solution code:
import collections
import sys
A = []
n = int(input())
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            A.append(i**2+j**2+k**2+i*j+j*k+k*i)
c = collections.Counter(A)


for x in range(1,n+1):
    print(c[x])
sys.exit()

Submission status: Accepted

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


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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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+j+k)**2-(i*j+i*k+j*k)
      if v < len(ans):
        ans[v] += 1
  
for x in range(1,N+1):
  print(ans[x])

Submission status: Accepted

Solution code:
L = 10**2+10
n = int(input())
ans = [0] * n
for i in range(1, L):
    for j in range(1, L):
        for k in range(1, L):
            x = i**2+j**2+k**2+i*j+j*k+i*k
            if x <= n:
                ans[x-1] += 1
print(*ans, sep="\n")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#3 
N = int(input())
answer = [0]*N
for k in range(1, int(N**(1/2))):
    for l in range(1, int(N**(1/2))):
        for m in range(1, int(N**(1/2))):
            v = k**2 + l**2 + m**2 + k*l + l*m + m*k
            if v-1 < N:
                answer[v-1] += 1
for i in range(N):
    print(answer[i])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))


N = int(input())

anss = [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))):
            tmp = x ** 2 + y ** 2 + z ** 2 + x*y + x*z + y*z
            if tmp <= N:
                anss[tmp] += 1 

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

Submission status: Accepted

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, 150):
  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: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lst = [0] * 10**6
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      t = (x**2 + y**2 + z**2 + (x+y+z)**2) // 2
      lst[t] += 1
for i in range(1, n+1):
  print(lst[i])