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:
import collections
n = int(raw_input())
h = collections.Counter()
for x in range(1,n+1):
	if x ** 2 > n:
		break
	for y in range(1,n+1):
		if x ** 2 + y ** 2 + x * y > n:
			break
		for z in range(1,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(1,n+1):
	print h[i]

Submission status: Accepted

Solution code:
n = int(input())
l = [0] * (10**5)
N = 10**4

for i in range(1, 10**2+1):
    for j in range(1, 10**2+1):
        for k in range(1, 10**2+1):
            a = i*i + j*j + k*k + i*j + j*k + k*i
            l[a] += 1

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

Submission status: Accepted

Solution code:
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n = int(input())
    ans = [0]*(n+1)
    lim = int(n**(0.5)) +1
    for i in range(1, lim):
        for j in range(1,lim):
            for k in range(1,lim): 
                tmp = i**2 + j**2 + k**2 +i*j + j*k+ k*i
                if tmp <= n:
                    ans[tmp] += 1
    for a in ans[1:]:
        print(a)   


if __name__ == '__main__':
    main()

Submission status: Accepted

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

results = [0]*N


def calc(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))):
    for y in range(1, int(math.sqrt(N))):
        for z in range(1, int(math.sqrt(N))):
            result = calc(x, y, z) - 1
            if result >= N:
                continue
            else:
                results[result] += 1

for result in results:
    print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

    anses = [0] * N

    for x in range(1, N):
        for y in range(x, N):
            for z in range(y, N):
                a = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if a > N:
                    break
                if x == y == z:
                    anses[a - 1] += 1
                elif x == y or y == z or z == x:
                    anses[a - 1] += 3
                else:
                    anses[a - 1] += 6
    
    for a in anses:
        print(a)

solve()

Submission status: Accepted

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

Submission status: Accepted

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, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      res[fun(x, y, z)] += 1
        
for n in range(1, N+1):
  print(res[n])

Submission status: Accepted

Solution code:
n=int(input())
#a=list(map(int,input().split()))
d=[0]*(2*10**6+1)
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      d[i**2+j**2+k**2+i*j+i*k+j*k]+=1
for i in range(1,n+1):
  print(d[i])

Submission status: Accepted

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


for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            ref = i**2 + j**2 + k**2 + i*j + j*k + i*k
            if ref <= 10000:
                l[ref - 1] += 1

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

Submission status: Accepted

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(1,101):
    for y in range(1,101):
        for z in range(1,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: Accepted

Solution code:
N = int(input())

m = int(N**0.5) + 2
l = [0]*(N+1)

for x in range(1, m):
    for y in range(1, m):
        for z in range(1, m):
            r = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if r <= N:
                l[r] += 1
                # print(r, (x, y, z))

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

Submission status: Accepted

Solution code:
n = int(input())
ans_dic = dict.fromkeys([i for i in range(1, 10**5)], 0)
for i in range(1, 10**2 + 1):
    for j in range(1, 10**2 + 1):
        for k in range(1, 10**2 + 1):
            tryvalue = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if tryvalue <= 10**4 + 3:
                ans_dic[tryvalue] += 1
for l in range(1, n + 1):
    print(ans_dic[l])

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    L = [0]*(N+1)
    for i in range(1,120):
        for j in range(1,120):
            for k in range(1,120):
                temp =  i**2 + j**2 + k**2 + i*j + j*k + k*i
                if N >= temp:
                    L[temp] += 1
                else:
                    break


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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
D=[0]*(10**4)
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      d=(i+j+k)**2-i*j-i*k-j*k
      if d<=10**4:
        D[d-1]+=1
for i in D[:N]:
  print(i)

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(10001)]
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            summ = i**2 + j**2 + k**2 + i * j + j * k + k * i
            if summ < 10001:
                ans[summ] += 1

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
import numba
from numba import njit
i8 = numba.int64

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

@njit((), cache=True)
def compute():
    f = np.zeros(10_001, 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 + x * z + y * z
                if n > 10000:
                    continue
                f[n] += 1
    return f

f = compute()

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

Submission status: Accepted

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

n = int(input())

list_ = [0]*(10**4)
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 <= 10**4:
                list_[a-1] += 1

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    f = [0] * n
    for x in range(1, n):
        if x * x > n:
            break
        for y in range(1, n):
            if x * x + y * y + x * y > n:
                break
            for z in range(1, n):
                if x * x + y * y + z * z + x * y + y * z + z * x > n:
                    break
                f[x * x + y * y + z * z + x * y + y * z + z * x - 1] += 1
    print(*f, sep="\n")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def func(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
n=int(input())
L=[0]*100000
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            L[func(x,y,z)]+=1
for i in range(1,n+1):
    print(L[i])

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())
#L,R,d = map(int, sys.stdin.readline().split())

cnt = [0 for i in range(N)]

# 間に合うかなーこれ。TLEしそう
for x in range(1,N+1):
    if x * x > N:
        continue
    for y in range(1, N+1):
        if x * y > N or y * y > N:
            continue
        for z in range(1, N+1):
            if z * z > N or x * z > N or z * y > N:
                continue

            n = x * x + y * y + z * z + x * y + y * z + z * x
            if n <= N:
                cnt[n-1] += 1

for n in cnt:
    print(n)

Submission status: Accepted

Solution code:
n = int(input())

dic = {}

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            fn = (x ** 2) + (y ** 2) + (z ** 2) + (x * y) + (y * z) + (z * x)
            if fn in dic:
                dic[fn] = dic[fn] + 1
            else:
                dic[fn] = 1

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

Submission status: Accepted

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[1:], sep="\n")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7

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

    for a in ans[1:]:
        print(a)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = int(input())
d = dict()

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

import math
sn = int(math.sqrt(N))

for x in range(1, sn + 2):
    for y in range(1, sn + 2):
        for z in range(1, sn + 2):
            n = calc(x, y, z)
            if n in d:
                d[n] += 1
            else:
                d[n] = 1

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

Submission status: Accepted

Solution code:
import math

N = int(input())
base = math.ceil(math.sqrt(N))

ans = [0] * (N + 1)

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

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

Submission status: Accepted

Solution code:

def resolve():
    n = int(input())
    a = [0] * (n+1)

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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+1]:
        print(t)

main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import *

N = int(input())
ans = [0]*(10**4+100)

x = 1
while x*x<=10**4:
    y = 1
    
    while x*x+y*y+x*y<=10**4:
        z = 1
        
        while x*x+y*y+z*z+x*y+y*z+z*x<=N:
            ans[x*x+y*y+z*z+x*y+y*z+z*x] += 1
            z += 1
        
        y += 1
    
    x += 1
    
for i in range(1, N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n = int(input())

my_dict = dict()

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            tmp = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if tmp in my_dict:
                my_dict[tmp] += 1
            else:
                my_dict[tmp] = 1

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

Submission status: Accepted

Solution code:
N = int(input())
C = {}
for x in range(1,142):
    for y in range(1,142):
        for z in range(1,142):
            a = (x+y)**2+(y+z)**2+(z+x)**2
            if a%2==0:
                if a//2 not in C:
                    C[a//2]=0
                C[a//2] += 1
for i in range(1,N+1):
    if i in C:
        print(C[i])
    else:
        print(0)

Submission status: Accepted

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

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      k = x**2+y**2+z**2+x*y+y*z+z*x
      if(k <= MAX):
        ANS[k] += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    val = [0] * 100000

    for x in range(1,101):
        for y in range(1,101):
            for z in range(1,101):
                val[calc(x,y,z)] += 1

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

memo = [0]*(10**4)

for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            temp = cal(i,j,k)
            if temp <= 10**4:
                memo[temp-1] += 1
for i in memo[:N]:
    print(i)

Submission status: Accepted

Solution code:
N = int(input())
ans = [0]*(N+1)
for x in range(1, 500):
    for y in range(1, 500):
        for z in range(1, 500):
            tmp = x**2+y**2+z**2+x*y+y*z+z*x
            if N >= tmp:
                ans[tmp] += 1
for a in ans[1:]:
    print(a)

Submission status: Accepted

Solution code:
from collections import defaultdict
import math
n = int(input())
# largest n is 10**4
m = int(math.sqrt(n)) + 1
d = defaultdict(int)
for i in range(1, m):
    for j in range(1, m):
        for k in range(1, m):
            d[i**2+j**2+k**2+i*j+j*k+k*i] += 1
for i in range(1, n+1):
    print(d[i])

Submission status: Accepted

Solution code:
from collections import defaultdict as dd
n = int(input())
counter = dd(int)
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 + z*x
            counter[ans] += 1

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

Submission status: Accepted

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

for x in range(1, 110):
    for y in range(1, 110):
        for z in range(1, 110):
            a = x*x + y*y + z*z +z*x + z*y + x*y
            if a <= N:
                cnt[a] += 1

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

Submission status: Accepted

Solution code:
N = int(input())

F = [0]*(N+1)
N2 = int(N**0.5)

for x in range(1, N2+1):
    n = x**2

    for y in range(1, N2+1):
        n2 = n + y**2 + x*y
        if n2 > N:
            break

        for z in range(1, N2+1):
            n3 = n2 + z**2 + y*z + z*x
            if n3 > N:
                break

            F[n3] += 1


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

Submission status: Accepted

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

for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            memo = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if memo <= 10**4:
                ans[memo] += 1


N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
ans = [0] * (N+1)
for x in range(1, 10**2):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            n = x*x + y*y + z*z + x*y + y*z + z*x
            if 1 <= n <= N:
                ans[n] += 1
print(*ans[1:], sep='\n')

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from functools import reduce, lru_cache
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline().rstrip())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    N = I()
    d = defaultdict(int)

    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):
                tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
                d[tmp] += 1
    for i in range(1, N+1):
        print(d[i])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import defaultdict
from itertools import product

N = int(input())

f = defaultdict(int)
for x, y, z in product(range(1, 100), repeat=3):
    n = x * x + y * y + z * z + x * y + y * z + z * x
    f[n] += 1

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

Submission status: Accepted

Solution code:
N=int(input())
list=[0 for i in range(10**4+1)]
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      f=i**2+j**2+k**2+i*j+i*k+j*k
      if f<10**4+1:
        list[f]+=1
for i in range(1,N+1):
      print(list[i])

Submission status: Accepted

Solution code:
from math import sqrt,ceil
def resolve():
    N =int(input())
    table=[0]*(N+1)
    mx = ceil(sqrt(N))
    for x in range(1,mx):
        for y in range(1,mx):
            for z in range(1,mx):
                n = x**2 + y**2 +z**2 +x*y+y*z +z*x

                if n > N:
                    break
                table[n]+=1

    for i in table[1:]:
        print(i)

resolve()

Submission status: Accepted

Solution code:
def main():
  ans = [0] *100000
  for i in range(1,  101):
    for j in range(1, 101):
      for k in range(1, 101):
        ans[i**2 + j**2 + k**2 + i*j + j*k + k*i-1] +=1
  n = int(input())
  for i in range(n):
    print(ans[i])
  
if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
n = int(input())

res = []
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            s = i**2 + j**2 + k**2 + i*j + j*k + k*i
            res.append(s)

from collections import Counter
count = Counter(res)

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

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline().strip())

ans = [0] * (10000+1)

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

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

Submission status: Accepted

Solution code:
n = 100
a = []
for i in range(1,n):
    for j in range(1,n):
        for k in range(1,n):
            a.append(i**2+j**2+k**2+i*j+j*k+k*i)

from collections import Counter
u = Counter(a)

n = int(input())
for i in range(1,n+1):
    if i in u.keys():
        print(u[i])
    else:
        print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = [0 for i in range(n)]
    m = 0
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                t = x**2+y**2+z**2+x*y+y*z+z*x
                if t>m:
                    m = t
                if t<n+1:
                    ans[t-1]+=1
    for i in range(n):
        print(ans[i])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

li = [0]*(10**4+1)

for i in range(1,100):
  for j in range(1,i+1):
    for k in range(1,j+1):
      value = i**2+j**2+k**2+i*j+j*k+k*i
      if value <= 10**4:
        if len(set([i,j,k])) == 3:
          li[value] += 6
        elif len(set([i,j,k])) == 2:
          li[value] += 3
        else:
          li[value] += 1

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

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())
    cnts = [0] * (10**4 + 1)
    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 + j * k + i * k
                if num <= 10**4:
                    cnts[num] += 1
    for i in range(1, N + 1):
        print(cnts[i])


resolve()

Submission status: Accepted

Solution code:
n=int(input())
ans=[0 for i in range(1+10**5)]
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            a=i**2+j**2+k**2+i*j+j*k+k*i
            ans[a]+=1
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    n = int(input())
    A = [0] * (n + 1)
    m = 0
    while (m + 1) ** 2 <= n:
        m = m + 1
    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
    for i in range(1, n + 1):
        print(A[i])

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Solution code:
n = int(input())
dp = [0] * 60005
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            dp[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1

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

Submission status: Accepted

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right,bisect
n=int(input())
ans=defaultdict(lambda:0)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            ans[x*x +y*y +z*z +x*y +y*z+x*z]+=1
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    res = [0 for i in range(n)]

    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                tmp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if tmp <= n:
                    res[tmp - 1] += 1

    res = "\n".join([str(r) for r in res])
    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = [int(i) for i in cin][0]

    cout = main(kwargs)
    print(cout)

Submission status: Accepted

Solution code:
N = int(input())
li = [0 for i in range(N+10)]

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

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

Submission status: Accepted

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
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
n = int(input())

cnt = [0] * (n+1)

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            val = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if val > n:
                continue
            cnt[val] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
d = defaultdict(int)
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):
            t = i**2 + j**2 + k**2 + i*j + j*k + k*i
            d[t] += 1
for i in range(1, N+1):
    print(d[i])

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
n = ii()
l = [0]*10001
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            num = x**2+y**2+z**2+x*y+y*z+z*x
            if num < 10001:
                if x==y and y==z:
                    l[num] += 1
                elif x==y or y==z:
                    l[num] += 3
                else:
                    l[num] += 6

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

Submission status: Accepted

Solution code:
from collections import defaultdict
def main():
    n = int(input())
    d = defaultdict(int)
    sn = int(n ** 0.5)
    for x in range(1, sn + 1):
        for y in range(x, sn + 1):
            for z in range(y, sn + 1):
                a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                b = len(set([x, y, z]))
                if b == 1:
                    d[a] += 1
                elif b == 2:
                    d[a] += 3
                else:
                    d[a] += 6
    [print(d[i]) for i in range(1, n + 1)]


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

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

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

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

Submission status: Accepted

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

Submission status: Accepted

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[1:], sep='\n')

Submission status: Accepted

Solution code:
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
ans=[0]*n
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            res=x**2+y**2+z**2+x*y+y*z+z*x
            if res>n:
              continue
            if x==y==z:
                ans[res-1]+=1
            elif (x==y and y!=z) or (y==z and x!=y):
                ans[res-1]+=3
            elif x!=y and y!=z:
                ans[res-1]+=6
for i in range(n):
    print(ans[i])

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    count = [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):
                res = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if res <= N:
                    count[res-1] += 1
    print(*count, sep="\n")
if __name__ == "__main__":
    main()