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:
N = int(input())
n = int(N**0.5)
d = {}
for x in range(1, n+1):
    for y in range(1, n+1):
        for z in range(1, n+1):
            c = x**2+y**2+z**2+x*y+y*z+z*x
            if c not in d:
                d[c] = 1
            else:
                d[c]+=1
for i in range(1, N+1):
    if i not in d:
        print(0)
    else:
        print(d[i])

Submission status: Accepted

Solution code:
N = int(input())

V = [0]*10000

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

for i in range (0, N):
    print(V[i])

Submission status: Accepted

Solution code:
n = 10 ** 2 + 1
a = {}
for x in range(1, n):
    for y in range(1, n):
        for z in range(1, n):
            f = x**2 + y ** 2 + z ** 2 + x*y + y*z + z*x
            a.setdefault(f, 0)
            a[f] += 1
N = int(input())
for i in range(1, N + 1):
    a.setdefault(i, 0)
    print(a[i])

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): 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()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n = k()

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

for i in a:
    print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())

d = defaultdict(int)

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

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

Submission status: Accepted

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd, cos, radians, floor
from functools import lru_cache, reduce
from decimal import Decimal
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
MAX = 10 ** 2
n = int(input())    
ans = [0 for i in range(n)]
for x in range(1, MAX + 1):
    for y in range(1, MAX + 1):
        for z in range(1, MAX + 1):
            a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if 0 <= a - 1 < n:
                ans[a - 1] += 1
for i in range(n):
    print(ans[i])

Submission status: Accepted

Solution code:

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

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
f = []
for _ in range(10000):
    f.append(0)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            id = x*x + y*y + z*z + x*y + y*z + z*x
            if id <= 10000:
                f[id-1] += 1
for i in range(n):
    print(f[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = [0]*10**4
for x in range(1,101):
    for y in range(1,int(N**0.5)+1):
        for z in range(1,int(N**0.5)+1):
            n = x**2+y**2+z**2+x*y+y*z+z*x
            if n<=10**4:
                ans[n-1]+=1

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

Submission status: Accepted

Solution code:
n=int(input())
a=[0]*(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):
      b=i**2+j**2+k**2+i*j+j*k+k*i-1
      if b<=10**4-1:
        a[b]+=1
for i in range(n):
  print(a[i])

Submission status: Accepted

Solution code:
n = int(input())
dp = [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):
            res = x**2+y**2+z**2+x*y+y*z+z*x
            if res<=n:
                dp[res]+=1

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

Submission status: Accepted

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

n = int(pow(N, 0.5))+1
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            res = i**2+j**2+k**2+i*j+j*k+k*i
            if res>N: break
            d[res] += 1
for i in range(1, N+1):
    print(d[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):
            X = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if X <= n:
                ans[X-1] += 1

for ansi in ans:
    print(ansi)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
def f(a,b,c):
    return a * a + b * b + c * c + a * b + b * c + a * c
c = [0] * n
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            x = f(i, j, k) - 1
            if x < n:
                c[x] += 1
for i in c:
    print(i)

Submission status: Accepted

Solution code:
N = int(input())

f = [0] * (N + 1)
for x in range(1, int(N ** 0.5) + 1):
    for y in range(1, int(N ** 0.5) + 1):
        for z in range(1, int(N ** 0.5) + 1):
            s = x * x + y * y + z * z + x * y + y * z + z * x
            if s <= N:
                f[s] += 1

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

Submission status: Accepted

Solution code:

import sys, io, os, re
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop

# sys.setrecursionlimit(5000)

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n, d=0): return [d] * n
def array2(n, m, d=0): return [[d] * m for x in range(n)]
def array3(n, m, l, d=0): return [[[d] * l for y in xrange(m)] for x in xrange(n)]
def linc(A, d=1): return map(lambda x: x + d, A)
def ldec(A, d=1): return map(lambda x: x - d, A)

N = n1()
rootN = int(ceil(sqrt(N)))

tbl = array1(10**4+1)

for i in range(1, rootN):
    for j in range(1, rootN):
        
        for k in range(1, rootN):
            n = i**2 + j**2 + k**2 + i*j + i*k + j*k
            if n <= 10000:
                tbl[n] += 1
            else:
                break

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

Submission status: Accepted

Solution code:
import math


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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# @author 

import sys

class CXYZTriplets:
    def solve(self, tc=0):
        from collections import defaultdict
        n = int(input())
        
        mp = defaultdict(int)
        for x in range(1, 101):
            for y in range(1, 101):
                for z in range(1, 101):
                    mp[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z] += 1
        for k in range(1, n + 1):
            ans = 0
            # r = int(n ** .5) + 1
            # for x in range(1, r):
            #     for y in range(1, r):
            #         for z in range(1, r):
            #             if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z == k:
            #                 ans += 1

            print(mp[k])

solver = CXYZTriplets()
input = sys.stdin.readline

solver.solve()

Submission status: Accepted

Solution code:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
from itertools import product

count_dic = {i: 0 for i in range(1, N+1)}
def func(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x

for x, y, z in list(product(range(1, 101), repeat=3)):
    res = func(x, y, z)
    if res > N:
        continue
    count_dic[res] += 1

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

Submission status: Accepted

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

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            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
            else:
                break

for ans in A:
    print(ans)

Submission status: Accepted

Solution code:
import math
import itertools
import collections
import bisect
import heapq

def IN(): return int(input())
def sIN(): return input()
def MAP(): return map(int,input().split())
def LMAP(): return list(map(int,input().split()))
def TATE(n): return [input() for i in range(n)]
MOD = 10**9 + 7

N = IN()
lis = [0]*N

for x in range(1,10**2 + 1):
  for y in range(1,10**2 + 1):
    for z in range(1,10**2 + 1):
      n = x**2 + y**2 + z**2 + x*y + y*z + z*x 
      if n > N:
        continue
      else:
        lis[n-1] += 1
      
for i in lis:
  print(i)

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter

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

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

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

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

    return

main()

Submission status: Accepted

Solution code:
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

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

def main():
    n = int(ipt())
    num = [0]*(n+1)
    for x in range(1,n):
        if calc(x,1,1) > n:
            break
        for y in range(1,n):
            if calc(x,y,1) > n:
                break
            for z in range(1,n):
                ci = calc(x,y,z)
                if ci > n:
                    break
                num[ci] += 1
    for i in num[1::]:
        print(i)

    return None

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys


def _i(): return int(sys.stdin.readline().strip())


def main():
    n = _i()
    ans = [0 for _ in range(n)]
    for x in range(1, 101):
        x2 = x**2
        for y in range(1, 101):
            xy = x * y
            y2 = y ** 2
            for z in range(1, 101):
                t = x2 + y2 + z**2 + xy + y*z + z*x
                if t <= n:
                    ans[t-1] += 1

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


if __name__ == "__main__":
    print(main())

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
def score(x,y,z):
    return pow(x,2)+pow(y,2)+pow(z,2)+(x*y)+(y*z)+(z*x)

N = int(input())

num = [0 for i in range(N)]
# x,y,zは高々10^2
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            value = score(x,y,z)
            if value <= N:
                num[value-1] += 1

for n in num:
    print(n)

Submission status: Accepted

Solution code:
n = int(input())

ans = [0] * (n + 1)
for x in range(1, n + 1):
    if x**2 + x >= n:
        break
    for y in range(1, n + 1):
        if x**2 + y**2 + x * y + x + y >= n:
            break
        for z in range(1, n + 1):
            w = x**2 + y**2 + z**2 + x * y + y * z + z * x
            if w > n:
                break
            else:
                ans[w] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = [ 0 for i in range(10**6)]

for i in range(1,150):
    for j in range(1,150):
        for k in range(1,150):
            tmp = i**2+j**2+k**2+i*j+j*k+k*i
            #num[tmp].append((i,j,k))
            num[tmp] += 1
N = int(input())

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 8)

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()
    ans = [0] * (10**4 + 1)

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

    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())

dp = [0] * 70000

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

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

Submission status: Accepted

Solution code:
n = int(input())
l = [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):
      tmp = i**2+j**2+k**2+i*j+j*k+k*i
      if tmp <= 10**4:
        l[tmp] += 1

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

Submission status: Accepted

Solution code:
n = int(input())
l = [0 for i in range(10**4+1)]
for x in range(1,10**2+1):
  for y in range(1,10**2+1):
    for z in range(1,10**2+1):
      t = x**2+y**2+z**2+x*y+y*z+z*x
      if t<=10**4:
        l[t] += 1
for i in range(1,n+1):
  print(l[i])

Submission status: Accepted

Solution code:
N = int(input())

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

for x in range(1, 100+1):
    for y in range(1, 100+1):
        for z in range(1, 100+1):
            n = x*x + y*y + z*z +x*y + y*z + z*x
            if n <= 10**4:
                L[n] += 1

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

Submission status: Accepted

Solution code:
n = int(input())

res = [0] * n
for s in range(1, 101):
    for t in range(1, 101):
        for u in range(1, 101):
            temp = (s + t) ** 2 + (s + u) ** 2 + (t + u) ** 2
            if temp > 2 * n:break
            if temp %2 == 0:
                res[temp//2 - 1] += 1

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

Submission status: Accepted

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

n=int(input())

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

for i in range(1,100):
    for q in range(1,100):
        for p in range(1,100):
            if calc(i,q,p)<=10**4:
                ans[calc(i,q,p)]+=1

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

Submission status: Accepted

Solution code:
N = int(input())

dict = [0] * N
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 > N:
                break
            else:
                dict[t-1] += 1

for ans in dict:
    print(ans)

Submission status: Accepted

Solution code:
# import sys
# readline = sys.stdin.readline
# generator = (readline().strip() for _ in range(N))

# N, M = map(int, input().split())
# As = list(map(int, input().split()))
# queries = (input() for _ in range(N))


def solve():

    N = int(input())

    counts = [0] * (N+1)

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

    return counts[:N]


def main():
    print(*solve())


if __name__ == "__main__":
    main()

Submission status: Accepted

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