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:
from collections import Counter
N = int(input())
N_ = int(N**0.5)+2

counter = Counter()
for x in range(1,N_):
    for y in range(1,N_):
        if N <= x**2+y**2+x*y:
            break
        for z in range(1,N_):
            tmp = x**2+y**2+z**2+x*y+y*z+z*x
            if N < tmp:
                break
            counter[tmp] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline()[:-1]


n = int(input())
if n==1:
    print(0)
else:
    max_x = int(((2*n-3)**0.5-1)//1)
    list_count = [0]*n
    for x in range(1,max_x+1):
        for y in range(1, max_x+2-x):
            for z in range(1, max_x+2-x-y):
                s = x**2+y**2+z**2+x*y+y*z+z*x
                if s>n:
                    continue
                else:
                    list_count[s-1] += 1
    for i in range(n):
        print(list_count[i])

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

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

def main():
    n = i_input()

    ans_list = []
    max_num = ceil(sqrt(n))
    for x in range(1,max_num):
        for y in range(1, max_num):
            for z in range(1, max_num):
                ans_list.append([x, y, z])
    
    result_list = []
    for x, y ,z in ans_list:
        result_list.append(f(x, y, z))

    result_dict = Counter(result_list)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
d=[0 for i in range(10**7)]
    
def jud(l):
    if len(set(l))==3:
        return 6
    if len(set(l))==2:
        return 3
    if len(set(l))==1:
        return 1

for i in range(1,101):
    for j in range(i,101):
        for k in range(j,101):
            l=[i,j,k]
            p=i**2+j**2+k**2+i*j+j*k+k*i
            d[p-1]+=jud(l)

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

Submission status: Accepted

Solution code:
n = int(input())
F = [0] * 300 ** 2

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

# x,y,zは高々10^2まで

N = int(input())

A = [0]*10001

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            index = x*x + y*y + z*z + x*y + y*z + z*x
            if index <= 10000:
                A[index] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def main():

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

    A = [0] * (10**4 + 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 <= 10**4:
                    A[n] += 1

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

    return


main()

Submission status: Accepted

Solution code:
N = int(input())
Pls = [0]*(10**4+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 <= 10**4:
                Pls[k] = Pls[k] + 1
Pls.pop(0)
for i in range(N):
    print(Pls[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
            if n <= N:
                ans[n-1] += 1
for i in range(N):
    print(ans[i])

Submission status: Accepted

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

for i in range(1,math.floor(math.sqrt(N))+1):
  for j in range(i,math.floor(math.sqrt(N))+1):
    for k in range(j,math.floor(math.sqrt(N))+1):
      if i == j == k and i*i+j*j+k*k+i*j+j*k+k*i-1 <= N-1:
        ans[i*i+j*j+k*k+i*j+j*k+k*i-1] += 1
      elif (i == j or j == k) and i*i+j*j+k*k+i*j+j*k+k*i-1 <= N-1:
        ans[i*i+j*j+k*k+i*j+j*k+k*i-1] += 3
      elif i*i+j*j+k*k+i*j+j*k+k*i-1 <= N-1:
        ans[i*i+j*j+k*k+i*j+j*k+k*i-1] += 6

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

Submission status: Accepted

Solution code:
import itertools
n=int(input())
l=[i for i in range(1,101)]
x=list(itertools.product(l,l,l))
d={i:0 for i in range(1,n+1)}
for i in range(len(x)):
	r=x[i][0]**2+x[i][1]**2+x[i][2]**2+(x[i][0]*x[i][1])+(x[i][1]*x[i][2])+(x[i][0]*x[i][2])
	if r>n:
		continue
	d[r]+=1

for u,v in d.items():
	print(v)

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:
N = int(input())
r = [0] * 10001
for x in range(100):
    x += 1
    for y in range(100):
        y += 1
        for z in range(100):
            z += 1
            i = x*x+y*y+z*z+x*y+y*z+z*x
            if i <= 10000:
                r[i] += 1

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

Submission status: Accepted

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

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

for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            ans = calc(i,j,k)
            if ans > 10000:
                break
            else:
                lis[ans] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = [0 for i in range(10**4 + 1)]

N = int(input())
for x in range(1, int(N**1 / 2) + 1):
    if x**2 > N:
        break
    for y in range(1, int(N**1 / 2) + 1):
        if x**2 + y**2 > N:
            break
        for z in range(1, int(N**1 / 2) + 1):
            temp = x**2 + y**2 + z**2 + x * y + y * z + z * x
            if temp > N:
                break
            else:

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

Submission status: Accepted

Solution code:
N = int(input())
sol = [0 for _ in range(N)]

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            v = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z
            if v > N:
                break
            else:
                sol[v - 1] += 1

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

Submission status: Accepted

Solution code:
import math

if __name__ == "__main__":
    N = int(input())
    f = {i: 0 for i in range(1, N + 1)}
    for x in range(1, int(math.sqrt(N)) + 2):
        for y in range(1, int(math.sqrt(N)) + 2):
            for z in range(1, int(math.sqrt(N)) + 2):
                try:
                    f[((x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2) // 2] += 1
                except KeyError:
                    pass
    for i in range(1, N + 1):
        print(f[i])

Submission status: Accepted

Solution code:
n = int(input())
lst = [0] * 10005
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            m = x**2 + y ** 2 + z ** 2 + x*y + y*z + x*z
            if m<10001:
                lst[m] += 1
            else:
                break
for i in range(1, n+1):
    print(lst[i])

Submission status: Accepted

Solution code:
import sys
import copy
from collections import deque
import collections
stdin = sys.stdin

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
dp = {i+1:0 for i in range(n)}

for x in range(1, n, 1):
    if 3*x*x+3*x > n:
        break
    for y in range(x, n, 1):
        if x*x+y*y+y*y+x*y+y*y+y*x > n:
            break
        for z in range(y, n, 1):
            tmp = x*x+y*y+z*z+x*y+x*z+y*z
            if n < tmp:
                break
            if x==y==z:
                dp[tmp] += 1
            elif x==y:
                dp[tmp] += 3
            elif y==z:
                dp[tmp] += 3
            else:
                dp[tmp] += 6

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

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

for i in ans:
    print(i)

Submission status: Accepted

Solution code:
from collections import defaultdict
def solve():
    N = int(input())
    counter = defaultdict(int)
    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 1 <= n <= N:
                    counter[n] += 1

    for i in range(1,N+1):
        print(counter[i])
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = int(input())
list = [0]*n
if n ==1:
  m = 1
else:
  m = int((n-2)**0.5)
for i in range(1, m):
  for j in range(i, m):
    for k in range(j, m):
      if i*i + j*j + k*k + i*j + j*k + k*i <= n:
        if i==j and j == k:
          list[i*i + j*j + k*k + i*j + j*k + k*i-1] += 1
        elif i == j or j == k:
          list[i*i + j*j + k*k + i*j + j*k + k*i-1] += 3
        else:
          list[i*i + j*j + k*k + i*j + j*k + k*i-1] += 6
      else:
        break
for i in range(n):
  print(list[i])

Submission status: Accepted

Solution code:
N = int(input())
x = 1
y = 1
z = 1
f = [0] * N
while True:
    y = x
    v = x**2 + y**2 + z**2 + x*y + y*z + z*x
    if v > N:
        break
    while True:
        z = y
        v = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if v > N:
            break
        while True:
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v > N:
                break
            else:
                if x == y:
                    if y==z:
                        f[v-1] += 1
                    else:
                        f[v-1] += 3
                else:
                    if y==z:
                        f[v-1] += 3
                    else:
                        f[v-1] += 6
            z += 1
        y += 1
    x += 1
for i in f:
    print(i)

Submission status: Accepted

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

M = 10 ** 2

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

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

Submission status: Accepted

Solution code:
import math

def main():
    N = int(input())
    ans = [0]*(N)
    n = int(math.sqrt(N))
    for x in range(1, n+1):
        for y in range(1, n+1):
            for z in range(1, n+1):
                s =x**2 + y**2 + z**2 + x*y + y*z + z*x
                if s < N+1:
                    ans[s - 1] += 1
    for i in ans:
        print(i)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from itertools import combinations_with_replacement
from collections import defaultdict

n = int(input())

calc = lambda x,y,z: x**2+y**2+z**2+x*y+y*z+z*x

def pattern(x,y,z):
   if x == y and y == z:
      return 1
   elif x == y or y == z or z == x:
      return 3
   elif x != y and y != z and z != x:
      return 6
   else:
      raise RuntimeError

d = defaultdict(int)
n_ = int(pow(n, 0.5))
nums = [i for i in range(1, n_+1)]
for x,y,z in combinations_with_replacement(nums, 3):
   d[calc(x,y,z)] += pattern(x,y,z)
for i in range(1, n+1):
   print(d[i])

Submission status: Accepted

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

a=[0]*n
b=[]
for i in range(1,101):
    b.append(i)
lst=list(itertools.product(b,repeat=3))

for i in range(len(lst)):
    x,y,z=lst[i][0],lst[i][1],lst[i][2]
    c=(x+y+z)**2-(x*y+y*z+z*x)
    if c<=n:
        a[c-1]+=1
    
for i in range(n):
    print(a[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n=ni()


cnt=[0]*(n+1)

for x in range(1,n+1):
  if x**2+x>n:
    break
  for y in range(x,n+1):
    if x**2+y**2+x*y+x+y>n:
      break
    for z in range(y,n+1):
      num = x**2+y**2+z**2+x*y+y*z+x*z
      if num > n:
        break
      if x==y==z:
        cnt[num]+=1
      elif x==y:
        cnt[num]+=3
      elif y==z:
        cnt[num]+=3
      elif x==z:
        cnt[num]+=3
      else:
        cnt[num]+=6

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

Submission status: Accepted

Solution code:
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
count = 0
ans = 0

N = i()

L = [0]*N

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

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil, sqrt
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

def main():
    from builtins import int, map
    N = int(input())
    ans = [0] * 20000

    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                v = x * x + y * y + z * z + x * y + y * z + z * x
                if v <= 10001:
                    ans[v] += 1
    for k in range(1, N + 1):
        print(ans[k])


if __name__ == '__main__':
    main()

Submission status: Accepted

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

n = int(input())

f = [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*x+y*y+z*z+x*y+y*z+z*x
            if tmp <= n:
                f[tmp-1] += 1

print("\n".join(map(str,f[:n])))

Submission status: Accepted

Solution code:
N = int(input())
A = [0]*(N+1)
L = int(N**0.5)+1
for x in range(1,L+1):
    for y in range(1,L+1):
        for z in range(1,L+1):
            num = x*x+y*y+z*z+x*y+y*z+z*x
            if num <= N:
                A[num] += 1
    

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

Submission status: Accepted

Solution code:
n = int(input())

ans = [0]*(n+1)
count = 0
for x in range(1, 101):
    count += 1
    if x**2 + 2*x > n:
        break
    for y in range(1, 101):
        if(x**2 + y**2 + x*y + 3) > n:
            break
        for z in range(1, 101):
            num = (x+y+z)**2 - x*y - y*z - z*x
            if num > n:
                break
            ans[num] += 1

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

Submission status: Accepted

Solution code:
#AIsing2020 c

import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
ans = [0]*N

for x in range(1,101):
    for y in range(x+1,101):
        for z in range(y+1,101):
            n = x**2+y**2+z**2+x*y+y*z+z*x
            if n <= N:
                ans[n-1] +=6
                
for x in range(1,101):
    y = x
    for z in range(1,101):
        if z == x:
            continue
        else:
            n = x**2+y**2+z**2+x*y+y*z+z*x
            if n <= N:
                ans[n-1] +=3

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

#############
# Main Code #
#############

N = getN()

num = [0] * (10 ** 4 + 10)

for x in range(1, 103):
    for y in range(1, 103):
        for z in range(1, 103):
            opt = (x ** 2) + (y ** 2) + (z ** 2) + (x * y) + (y * z) + (z * x)
            if opt < 10 ** 4 + 9:
                num[opt] += 1

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

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

Submission status: Accepted

Solution code:
import math

n = int(input())


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


dp = [0 for _ in range(60001)]
C = 100
for i in range(1, C):
    for j in range(1, C):
        for k in range(1, C):
            dp[f(i, j, k)] += 1

print(*dp[1:n + 1])

Submission status: Accepted

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


for a in range(int((2*n)**(1/2))+1):
    r1 = 2*n-a**2
    for b in range(int(r1**(1/2))+1):
        r2 = r1-b*2
        if r2 < 0: continue
        for c in range(int(r2**(1/2))+1):
            if 0<a**2<2*n and 0<b**2<2*n and 0<c**2<2*n:
                s = a**2 + b**2 + c**2
                if s%2==1 or s>2*n: continue
                x = (a+b+c)//2-a
                y = (a+b+c)//2-b
                z = (a+b+c)//2-c
                if x>=1 and y>=1 and z>=1:
                    # print(x, y, z)
                    memo[s//2] += 1

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

Submission status: Accepted

Solution code:
N = int(input())

results = [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, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      w = g(x,y,z)
      if w > N:
        break
      else:
        results[w - 1] += 1

for result in results:
  print(result)

Submission status: Accepted

Solution code:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()

ans = defaultdict(int)

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

Submission status: Accepted

Solution code:
import math as m


n = int(input())

l = [0] * 10000

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
            if  ans <= 10000:
                l[ans-1] += 1

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

Submission status: Accepted

Solution code:
n = int(input())

f = [0] * n
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 <= n):
                f[x * x + y * y + z * z + x * y + y * z + z * x - 1] += 1
for i in range(n):
    print(f[i])

Submission status: Accepted

Solution code:
N = int(input())
A = [0] * (10**4+1)
import math
import numpy
tmp=0
for i in range(1,int(math.sqrt(N))):
    for j in range(1,int(math.sqrt(N))):
        for k in range(1,int(math.sqrt(N))):
            tmp=(i+j+k)**2-(i*j+j*k+i*k)
            if tmp<=10**4:
                A[tmp]+=1
for p in A[1:N+1]:
    print(p)

Submission status: Accepted

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

for i in range(1,min(n,100)):
	for j in range(1,min(n,100)):
		for k in range(1,min(n,100)):
			if i+j+k <= 150:
				p = (i+j+k)**2-(i*j)-(j*k)-(i*k)
				d[p]+=1

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
def main():
    N = int(input())
    N_MAX = 10000

    bucket = [0]*N_MAX
    for x in range(1, 100):
        for y in range(1, x+1):
            for z in range(1, y+1):
                n = x*x+y*y+z*z+x*y+y*z+z*x
                if n <= N_MAX:
                    if x==y and y==z:
                        bucket[n-1] += 1
                    elif x==y or y==z:
                        bucket[n-1] += 3
                    else:
                        bucket[n-1] += 6
    for f_n in bucket[:N]:
        print(f_n)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())


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

    hist = [0] * 100*100*100

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

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
n=int(input())
ans=[0 for i in range(n)]
for x in range(1,100):
  for y in range(1,x+1):
    for z in range(1,y+1):
      i=x**2+y**2+z**2+x*y+y*z+z*x
      if i<=n:
        if x==y and y==z:
          ans[i-1]+=1
        elif x==y or y==z:
          ans[i-1]+=3
        else:
          ans[i-1]+=6
for i in ans:
  print(i)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    cnt = [0] * N
    mx = int(N ** 0.5)
    for x in range(1, mx):
        for y in range(1, mx):
            Z = N - (x ** 2 + y ** 2 + x * y)
            if Z <= 0: continue
            Z = int(Z ** 0.5)
            for z in range(1, Z + 1):
                n = f(x, y, z)
                if n <= N:
                    cnt[n - 1] += 1

    for c in cnt:
        print(c)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import defaultdict
dict=defaultdict(lambda:0)
n=int(input())

for x in range(1,100):
    for y in range(1, 100):
        for z in range(1,100):
            p=(x+y+z)**2-(x*y+y*z+z*x)
            dict[p]+=1

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

Submission status: Accepted

Solution code:
arr = [0 for i in range(10001)]
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            if i*i + j*j + k*k +i*j + j*k + k*i <=10**4:
                arr[i*i + j*j + k*k +i*j + j*k + k*i]+=1

n = int(input())
for i in range(1,n+1):
    print(arr[i],end= " ")

Submission status: Accepted

Solution code:
N=int(input())
dp=[0]*(10**4+1)
for i in range(1,100+1):
  for j in range(1,100+1):
    for k in range(1,100+1):
      a=(i+j)**2+(k+j)**2+(i+k)**2
      if 10**4<a//2:
        break
      dp[a//2]+=1
for l in range(1,N+1):
  print(dp[l])

Submission status: Accepted

Solution code:
N = int(input())
a = [0]*10**5
a = [0]+a
x = 0
y = 0
z = 0
total = 0
for i in range(1,101):
  x = i
  for j in range(i,101):
    y = j
    for k in range(i,j+1):
      z = k
      total = int(((x+y)**2+(y+z)**2+(z+x)**2)/2)
      if(x==y and y==z):
        a[total]+=1
      elif(x==y or y==z or z==x):
        a[total]+=3
      else:
        a[total]+=6
for l in range(1,N+1):
  print(a[l])

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
ans_list = [0] * n
if n != 1:
    for x in range(1, int((n-2)**0.5)):
        for y in range(1, int((n-2)**0.5)):
            for z in range(1, int((n-2)**0.5)):
                k = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if k <= n:
                    ans_list[k - 1] += 1
                else:
                    break

for ans in ans_list:
    print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

for n in range(1, N + 1):
    cnt = 0
    for x in range(1, n + 1):
        for y in range(1, n + 1):
            xy = n - (x ** 2 + y ** 2 + x * y)
            if xy < 0:
                break
            p = x + y
            q = p ** 2 + 4 * xy
            if int(math.sqrt(q)) ** 2 == q:
                d = -p + int(math.sqrt(q))
                if d % 2 == 0 and d > 0:
                    cnt += 1

        else:
            break

    print(cnt)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**8)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(1,n+1):
    print(lis[i])

Submission status: Accepted

Solution code:
n = int(input())

x,y,z =1,1,1
a = 0
for i in range(1,101):
    if i**2+1**2+1**2+i*1+1*1+1*i >n:
        a = i
        break
    

L = {}

for x in range(1,a):
    for y in range(1,a):
        for z in range(1,a):
            b = x**2+y**2+z**2+x*y+y*z+z*x
            if b <= n:
                if b in L:
                    L[b] = L[b] +1
                else:
                    L[b] = 1

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

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