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

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**6)
INF = float("inf")

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

    F = [0]*(N+1)
    for x in range(1, int(N**.5)+1):
        for y in range(1, int(N**.5)+1):
            for z in range(1, int(N**.5)+1):
                a = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if a <= N:
                    F[a] += 1
    
    for i in range(1,N+1):
        print(F[i])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
final_dict = {}
for x in range(1,n):
    for y in range(1,n):
        p = x*x + y*y 
        if p>=n:
            break
        for z in range(1,n):
            if p+z*z >=n:
                break
            val = (p + z*z +x*y +y*z +x*z)
            if val in final_dict:
                final_dict[val]+=1
            else:
                final_dict[val]=1
for i in range(1,n+1):
    p = 0
    if i in final_dict:
        p = final_dict[i]
    print(p)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(10001)]
for i in range(1,101):
	for j in range(1,101):
		for k in range(1,101):
			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())

ans = [0] * (N + 1)

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

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

Submission status: Accepted

Solution code:
n=int(input())
ans=[0]*(10001)
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      index=i**2+j**2+k**2+i*j+j*k+i*k
      if index<=10000:
        ans[index]+=1
     
for i in range(1,n+1):
  print(ans[i])

Submission status: Accepted

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

n = int(input())
ans = [0] * (n+1)
m = int(n**(1/2)) + 1
for x in range(1, m):
    for y in range(1, m):
        for z in range(1, m):
            res = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if res <= n:
                ans[res] += 1
for i in ans[1:]:
    print(i)

Submission status: Accepted

Solution code:
import math
n=int(input())
t=int(math.sqrt(n))
ans=[0 for i in range(100001)]
for j in range(1,t):
  for k in range(1,t):
    for l in range(1,t):
      s=j**2+k**2+l**2+j*k+k*l+j*l
      if s<10001:
        ans[s]+=1
          
for m in range(1,n+1):
  print(ans[m])

Submission status: Accepted

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


n_max=math.ceil(math.sqrt(N))
res=[0]*(N+1)

for x in range(1,n_max+1):
  for y in range(1,n_max+1):
    for z in range(1,n_max+1):
      v=x*x+y*y+z*z+x*y+y*z+z*x
      if v <= N:
        res[v]+=1

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

Submission status: Accepted

Solution code:
N = int(input())
ans_list = [0 for _ in range(1,10100)]

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

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

Submission status: Accepted

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

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

print(*ans)

Submission status: Accepted

Solution code:
def f(x,y,z):
    n=x**2 + y**2 + z**2 + x*y + y*z + z*x
    return n

N=int(input())

anslist=[0]*60100

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            n= f(x,y,z)
            anslist[n-1]+=1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            value = x*x + y*y + z*z + x*y + y*z + z*x
            if value <= 11000:
                cnt[value] += 1
for i in range(1,N+1):
    print(cnt[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:
N = int(input())
from collections import defaultdict
ans = defaultdict(int)
for a in range(1,101):
  for b in range(1,101):
    for c in range(1,101):
      ans[a**2 + b**2 + c**2 + a*b + a*c + b*c] += 1
for n in range(1,N+1):
  print(ans[n])

Submission status: Accepted

Solution code:
import math
n = int(input())
ans = [0] * n
a = math.floor(n**0.5)
b = 0
for x in range(1, a):
    for y in range(1, a):
        for z in range(1, a):
            m = x * x + y * y + z * z + x * y + y * z + z * x
            if m <= n:
                ans[m - 1] += 1

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

anslist = [0] * N

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):
            a = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if a <= N:
                anslist[a-1] += 1
    

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict as d
dico = d(int)
n = int(input())
for x in range(1,101):
  for y in range (1, 101):
    for z in range (1,101):
      s = x**2+y**2+z**2+x*y+x*z+y*z
      if s > n:break
      dico[s]+=1
for i in range(1, n+1):
  print(dico[i])

Submission status: Accepted

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

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import collections

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

Submission status: Accepted

Solution code:
import math
N=int(input())
n= int(math.sqrt(N))
ans = [0]*(N+1)

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

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

Submission status: Accepted

Solution code:
import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    c = collections.Counter()

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

n=int(input())
an=[0]*n
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            wk=ff(i,j,k)
            if wk<=n:
                an[wk-1]+=1
for i in an:
    print(i)

Submission status: Accepted

Solution code:
import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    c = collections.Counter()

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x * x + y * y + z * z + x * y + y * z + z * x >= 10001:
                    continue
                c[x * x + y * y + z * z + x * y + y * z + z * x] += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
n=int(input())
M=int(math.sqrt(n))
N=3

A=[]
def dfs(nums,length):
    if length==N:
        A.append(nums)
        return
    for i in range(1,M+1):
        new_nums=nums+[i]
        dfs(new_nums,length+1)
dfs([],0)

dp=[0 for i in range(n)]
for i,j,k in A:
    ans=i**2+j**2+k**2+i*j+j*k+k*i
    if ans<=n:
        if i==j and j==k:
            dp[ans-1]+=1
        elif i==j or j==k or k==i:
            dp[ans-1]+=1
        else:
            dp[ans-1]+=1
for i in dp:
    print(i)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math

n = int(input())
answer_lists = [0 for i in range(10001)]
for x in range(1, int(math.sqrt(n+1)), 1):
    for y in range(1, int(math.sqrt(n+1)), 1):
        for z in range(1, int(math.sqrt(n+1)), 1):
            formula = (x+y+z)**2 - (x*y + y*z + z*x)
            if formula <= n:
                answer_lists[formula] += 1
            else:
                break
for i in range(1, n+1, 1):
    print(answer_lists[i])

Submission status: Accepted

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

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:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

N = int(input())
if N > 100:
    n = int(np.sqrt(N)) + 5
else:
    n = N
n_np = np.zeros(105**3)
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            idx = i**2 + j**2 + k **2 + i*j + i*k + j*k
            n_np[idx-1] += 1
for i in range(N):
    print(int(n_np[i]))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())
ans = [0] * 10001
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))):
            t = x**2+y**2+z**2+x*y+y*z+z*x
            if t <= n:
                ans[t] += 1
for i in range(1, n+1):
    print(ans[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):
            tmp=x*x + y*y + z*z + x*y + y*z + z*x
            if tmp <=n:
                cnt[tmp]+=1


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

Submission status: Accepted

Solution code:
import numpy as np

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

def tansaku(N, A):
    for i in range(1, 101):
        for j in range(i, 101):
            for k in range(j, 101):
                n = f(i, j, k)
                if(n>N):
                    break;
                if((i==j) and (j==k)):
                    A[n] += 1
                if((i==j) and (j!=k)):
                    A[n] += 3
                if((i!=j) and (j==k)):
                    A[n] += 3
                if((i!=j) and (j!=k)):
                    A[n] += 6
    return A

def main():
    N = int(input())
    A = np.zeros(N+1)
    A = tansaku(N, A)
    for i in range(1,N+1):
        print('{:d}'.format(int(A[i])))


main()

Submission status: Accepted

Solution code:
import numpy as np

def tansaku(N, A):
    for i in range(1, 101):
        for j in range(i, 101):
            for k in range(j, 101):
                n = i*i + j*j + k*k + i*j + j*k + k*i
                if(n>N):
                    break;
                if((i==j) and (j==k)):
                    A[n] += 1
                if((i==j) and (j!=k)):
                    A[n] += 3
                if((i!=j) and (j==k)):
                    A[n] += 3
                if((i!=j) and (j!=k)):
                    A[n] += 6
    return A

def main():
    N = int(input())
    A = np.zeros(N+1)
    A = tansaku(N, A)
    for i in range(1,N+1):
        print('{:d}'.format(int(A[i])))


main()

Submission status: Accepted

Solution code:
import math

n = int(input())

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

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

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

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import ceil

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    
    ans = [0] * (N + 1)
    for x in range(1, ceil(N ** 0.5) + 1):
        for y in range(1, ceil(N ** 0.5) + 1):
            tmp = x ** 2 + y ** 2 + x * y
            if N <= tmp:
                break
            for z in range(1, ceil(N ** 0.5) + 1):
                n = tmp + z ** 2 + y * z + z * x
                if n <= N:
                    ans[n] += 1
    print(*ans[1:], sep='\n')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import itertools

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

Submission status: Accepted

Solution code:
import math
from queue import PriorityQueue
from sys import stdin,stdout
from collections import defaultdict

def solve():
    n=int(input())
    ans=[0 for _ in range(200050)]
    for i in range(1,101):
        for j in range(1,101):
            for k in range(1,101):
                v=i*i+j*j+k*k+i*j+k*j+k*i
                ans[v]+=1
    for i in range(n):
        print(ans[i+1])
    

    
    
    
def main():
    solve()
main()

Submission status: Accepted

Solution code:
n=int(input())
v=[0]*10001
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      d=x*x+y*y+z*z+x*y+x*z+y*z
      if d>10000:
        continue
      else:
        v[d]+=1
for i in range(n):
  print(v[i+1])

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
from itertools import product

N = int(input())

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

print(*ans[1:], sep='\n')

Submission status: Accepted

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

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

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

    MII = map_int_input

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

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

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

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

    LII = list_int_inputs

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

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

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

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

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

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

                if f <= N:
                    ans[f - 1] += 1
                    # if x == y == z:
                    #     ans[f - 1] += 1
                    # else:
                    #     ans[f - 1] += 3

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

Submission status: Accepted

Solution code:
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
ans ={i:0 for i in range(1,N +1)}
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            a =x*x +y*y +z*z +x*y +y*z +z*x
            if a<= N:
                ans[a] +=1
for i in range(1,N+1):
    print(ans[i])

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:
from collections import defaultdict

d = defaultdict(int)
def f():
  global d
  for x in range(1, 10**2+1):
    x2 = x**2
    if x2 >= 10**4:
      break
    for y in range(x, 10**2+1):
      y2 = y**2
      if x2 + y2 >= 10**4:
        break
      for z in range(y, 10**2+1):
        z2 = z**2
        num = x2 + y2 + z2 + x*y + y*z + z*x
        if num > 10**4:
          break
        l = len(set([x, y, z]))
        if l == 1:
            d[num] += 1
        elif l == 2:
            d[num] += 3
        else:
            d[num] += 6
  return True

_ = f()
N = int(input())
ans = []
for i in range(1, N+1):
  ans.append(d[i])

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

Submission status: Accepted

Solution code:
import math

n = int(input())
ans = {}

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

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):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            # print(x,y,z,a)
            if a in ans:
                ans[a] += 1

for a in ans.values():
    print(a)

Submission status: Accepted

Solution code:
import sys


def resolve():
    import numpy as np

    readline = sys.stdin.readline

    N = int(readline())

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

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

resolve()

Submission status: Accepted

Solution code:
n = int(input())
#from tqdm import tqdm
ans=[0 for _ in range(10001)]
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < 10001:
                ans[v]+=1
                #print(i, x,y,z)
for i in range(n):
    print(ans[i+1])

Submission status: Accepted

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

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

Submission status: Accepted

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

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            p = (x+y)*(x+z)+y**2+z**2
            if p > N:
                break
            else:
                lst[p] += 1
for i in range(1,N+1):
    print(lst[i])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
N = int(input())
ans = [0 for i in range(0,N)]
for x, y, z in itertools.product(range(1,int(N**(1/2)+1)),range(1,int(N**(1/2)+1)),range(1,int(N**(1/2)+1))):
    kai = x**2+y**2+z**2+x*y+x*z+y*z
    if 0 < kai <= N:
        ans[kai-1] += 1

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N = int(input())

Ans = 0
numlist = [0] * 10001

if int(float(N)**0.5) <= 1:
  rMax = 1
else:
  rMax = int(float(N)**0.5)  

for x in range(1,rMax+1):
  for y in range(1,rMax+1):
    for z in range(1,rMax+1):
      Ans = x**2 + y**2 + z**2 + (x * y) + (y * z) + (z * x)
      if Ans <= 10000:
        numlist[Ans] += 1
  
for r in range(1,N+1):
  print(numlist[r])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np


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

    ans = np.zeros(10050, int)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

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):
            n = x * x + y * y + z * z + x * y + y * z + z * x
            if n > N:
                break
            result[n] += 1

print(*result[1:], sep='\n')

Submission status: Accepted

Solution code:
N = int(input())

t = [0] * (N + 1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            n = x * x + y * y + z * z + x * y + y * z + z * x
            if n > N:
                break
            t[n] += 1

print(*t[1:], sep='\n')

Submission status: Accepted

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

def main():
    N = int(input())
    #s = x+ y+ z
    ret =[0]*(N+1)
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                n = x**2+y**2+z**2+x*y+y*z+z*x
                if n<=N:
                    ret[n] += 1
    for i in ret[1:N+1]:
        print(i)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
ans=[0 for _ in range(10050)]
for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            v=x**2+y**2+z**2+x*y+y*z+z*x
            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 x in range(1,101):
  for z in range(1,101):
    for y in range(1,101):
      a=(x+y+z)**2-(x*y+y*z+z*x)
      if a<=n:
          ans[a-1]+=1
for i in ans:
  print(i)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math
import collections


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    list_counter = collections.Counter()

    for i in range(1, math.floor(N**(1/2))+1):
        for j in range(1,  math.floor(N**(1/2))+1):
            for k in range(1,  math.floor(N**(1/2))+1):
                n = i**2 + j**2 + k**2 + i*j + j*k + k*i
                list_counter.update({n: 1})

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


    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()