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: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import deque


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

    cnt_all = deque([])
    for n in range(1, N + 1):
        cnt = 0

        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 == n:
                        cnt += 1
                    elif ans > n:
                        break
        # ---------
        cnt_all.append(str(cnt))

    print("\n".join(cnt_all))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=[0]*(10**5)
L=list(i for i in range(1,40))

from itertools import*
P=list(product(L,repeat=3))
for x,y,z in P:
    ans[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1

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

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    r = [0]*100000
    for i1 in range(1,20):
        for i2 in range(1,20):
            for i3 in range(1,20):
                t = i1**2 + i2**2 + i3**2 + i1*i2 + i2*i3 + i1*i3
                r[t] += 1
    print(*r[1:n+1],sep='\n')
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

highest = int(math.sqrt(n//3))+1
l = [0]*n
cal = 0

for x in range(1, highest+1):
  for y in range(1, highest+1):
    for z in range(1, highest+1):
      cal = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if cal > n-1:
        continue
      else:
        l[cal-1] += 1
        
for i in range(len(l)):
  print(l[i])

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = [0 for i in range(n)]
for i in range(1,100):
    for j in range(i,100):
        for k in range(j,100):
            if i*i + j*j + k*k + i*j + k*j + i*k > n:
                break
            if i == j and j==k:
                ans[i*i + j*j + k*k + i*j + k*j + i*k-1] = 1
            elif i == j or j==k or k==j:
                ans[i*i + j*j + k*k + i*j + k*j + i*k-1] = 3
            else:
                ans[i*i + j*j + k*k + i*j + k*j + i*k-1] = 6

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

Submission status: Wrong Answer

Solution code:
N = int(input())

dp = [0 for _ in range(N+1)]
for x in range(1,int(N**0.5)+1):
    if x * x > N:
        continue
    for y in range(1,int(N**0.5)+1):
        if x * x + y * y + x * x > N:
            continue
        for z in range(1,int(N**0.5)+1):
            t = x * x + y * y + z * z + x * y + y * z + z * x
            if t <= N:
                dp[t] += 1

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

Submission status: Wrong Answer

Solution code:
n=int(input())
d={}
for i in range(10**4):
    d[i]=0
    
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(1,101):
        for k in range(1,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: Wrong Answer

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, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            opt = (x ** 2) + (y ** 2) + (z ** 2) + (x * y) + (y * z) + (z * x)
            if opt < 10 ** 2 + 9:
                num[opt] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(5):
    print(0)
count = [0] * (10**6)
s = 0

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            s = i * i + j * j + k * k + i * j + j * k + k * i 
            count[s] += 1
for i in range(n):
    print(count[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
n = int(N**(1/2))

ans_list = [0]*(N)

for i in range(1,n):
    for j in range(i,n):
        for k in range(j,n):
            index = i**2+j**2+k**2+i*j+j*k+k*i

            if index>N:
                break
            if (i == j) and (j==k):
                ans_list[index-1] += 1
            else:
                ans_list[index - 1] += 3
for i in ans_list:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def det(x,y,n):
    return (x+y)**2 - 4*(x**2 + y**2 + x*y - n)
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

n = int(input())

for i in range(1,n):
    ans = 0
    for x in range(1,int(pow(n,0.5))+2):
        for y in range(1,int(pow(n,0.5))+2):
            D = det(x,y,i)
            #if x == 1 and y == 1:
                #print(D)
            if D >= 0 and is_integer_num(pow(D,0.5)):
                if -(x+y) + pow(D,0.5) > 0:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

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,50):
        for y in range(1,50):
            for z in range(1,50):
                tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if tmp <= N:
                    f[tmp] += 1
    
    print("\n".join(map(str, f[1:])))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

a=[0]*n
b=[]
for i in range(1,35):
    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: Wrong Answer

Solution code:
def f(n):
    res = 0
    for x in range(1, 30):
        for y in range(x, 30):
            for z in range(y, 30):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
                    if x == y == z:
                        res += 1
                    elif x != y != z:
                        res += 6
                    else:
                        res += 3
    return res


N = int(input())
for i in range(1, N + 1):
    print(f(i))

Submission status: Wrong Answer

Solution code:
n=int(input())

ch=[0]*10001

for i in range(1,100):
  for j in range(1,100):
    for k in range(1,100):
      x=i**2+j**2+k**2+i*j+j*k+k*i
      if x<10000:
        ch[x]+=1
for i in range(n):
  print(ch[i+1])

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = [0]*60001

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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

N = int(input())
x = 0
ans = [0 for _ in range(N)]
maxv = ceil(sqrt(N / 6))
for x in range(1, maxv+1):
    for y in range(1, maxv+1):
        for z in range(1, maxv+1):
            f = x*x + y*y + z*z + x*y + y*z + z*x
            if f > N: continue
            ans[f - 1] += 1
for i in range(N):
    print(ans[i])

Submission status: Wrong Answer

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

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())

f_solo = []
f_multi = []
for x in range(1, 50):
    for y in range(x, 50):
        for z in range(y, 50):
            acc = x * x + y * y + z * z + x * y + y * z + x * z
            if x == y == z:
                f_solo.append(acc)
            else:
                f_multi.append(acc)

for i in range(1, N + 1):
    if i in f_solo:
        print(1)
    elif i in f_multi:
        print(3)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [0 for i in range(n+1)]
for i in range(1, n):
  x = (i**2)*6
  if x <= n:
    l[x] = 1
  else:
    break

x = 11
s = 7
for _ in range(n):
  if x <= n:
    l[x] = 3
    x += s
    s += 2
  else:
    break
    
x = 17
s = 17
for _ in range(n):
  if x <= n:
    l[x] = 3
    x += s
    s += 6
  else:
    break

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

Submission status: Wrong Answer

Solution code:

N=int(input())
for n in range(1,N):
    ans=0
    for x in range(1,101):
        t=0
        t+=x**2
        if t>n :
            continue
        for y in range(1,101):
            t+=y**2+x*y
            if t>n :
                continue
            for z in range(1,101):
                t+=z**2+z*(x+y)
                if t>n :
                    continue
                elif t==n:
                    ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
#A = list(map(int, input().split()))

ans = [0 for _ in range(N)]
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      k = (x+y)**2+(y+z)**2+(z+x)**2
      if k % 2 == 0 and k < 2*N:
        ans[((x+y)**2+(y+z)**2+(z+x)**2)//2-1] += 1

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

Submission status: Wrong Answer

Solution code:
from math import sqrt
l = [-1]+[0]*10**4
n = int(input())
for i in range(1,int(sqrt(n))+2):
    for j in range(1,int(sqrt(n))+2):
        for k in range(1,int(sqrt(n))+2):
            ans = i**2+j**2+k**2+i*j+j*k+k*i
            if ans <= 10*4:
                l[ans] += 1
for i in range(1,n+1):
    print(l[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input(""))
for i in range(n):
    s=0
    for k in range(int(math.sqrt(n))):
        for ii in range(k+1):
            for kk in range(ii+1):
                if((k+1)**2+(ii+1)**2+(kk+1)**2+(k+1)*(ii+1)+(k+1)*(kk+1)+(ii+1)*(kk+1)==i):
                    if(k==ii and k==kk):
                        s+=1
                    elif(k==ii or k==kk or ii==kk):
                        s+=3
                    else:
                        s+=6







    print(s)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=[0]*(10**5)
L=list(i for i in range(1,37))

from itertools import*
P=list(product(L,repeat=3))
for x,y,z in P:
    ans[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1

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

Submission status: Wrong Answer

Solution code:
N  = int(input())

from collections import defaultdict
ansd = defaultdict(int)

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

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

for k in range(1, N+1):
    print(ansd[k])

Submission status: Wrong Answer

Solution code:
import math
LI = lambda: list(map(int,input().split()) )
MI = lambda: map(int,input().split())
SI = lambda: input()
II = lambda: int(input())
n = II()
l = [0]*(10**4+1)
m = 10**4
lim = int(m**0.5)+1
for i in range(1,lim):
    for j in range(i,lim):
        for z in range(j,lim):
            s = i**2+j**2+z**2+i*j+i*z+j*z
            if s>m:
                continue
            if i == j == z:
                l[s] = 1
            elif i == j or j == z or i == z:
                l[s] = 3
            else:
                l[s] = 6
for i in range(1,n+1):
    print(l[i])

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
l = list()
for i in range(1,31):
    l.append((i, i**2))
# print(l)
c = Counter()
for X in l:
    for Y in l:
        for Z in l:
            x = X[0]
            y = Y[0]
            z = Z[0]
            c[X[1]+Y[1]+Z[1]+x*y+y*z+x*z] += 1

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np


def solve(N: int):
    F = 60
    p = [0] * (F**3)
    for x in range(1,F):
        for y in range(1,F):
            for z in range(1,F):
                p[x*x+y*y+z*z+x*y+y*z+z*x] += 1

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


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
on = int(input())
res = 0
for n in range(1, on + 1):
    res = 0
    for x in range(1,100+1):
        nn = n
        nn -= x*x
        if nn < 0:
            break
        for y in range(x, 100 + 1):
            nn -= y*y
            nn -= x*y
            if nn < 0:
                break
            for z in range(y, 100 + 1):
                if x*x + y*y + z*z + x*y + y*z + z*x == n:
                    dat = [x, y ,z]
                    dat.sort()
                    a,b,c = dat
                    if a == b == c:
                        res += 1
                    elif a == b and b != c:
                        res += 3
                    elif c == b and a != b:
                        res += 3
                    elif a != b and b != c:
                        res += 6
                    #print(n, x, y, z)
                if nn < 0:
                    break

    print(res)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N = INT()
ans = [0]*N

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def f(n):
    res = 0
    for x in range(1, 15):
        for y in range(x, 15):
            for z in range(y, 15):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
                    if x == y == z:
                        res += 1
                    elif x != y != z:
                        res += 6
                    else:
                        res += 3
    return res


N = int(input())
for i in range(1, N + 1):
    print(f(i))

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

N = INT()

C = Counter()
for x in range(1, N+1):
    y = z = x
    n = x**2 + y**2 + z**2 + x*y + y*z + z*x
    C[n] += 1
for x in range(1, N+1):
    for y in range(1, N+1):
        if x == y:
            continue
        z = y
        n = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if n > N:
            break
        C[n] += 3

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

Submission status: Wrong Answer

Solution code:
"""
NTC here
"""


#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase

profile = 0
pypy = 1


def iin(): return int(input())


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



def main():
    T = 1
    while T:
        T -= 1
        n = iin()
        mx = 10**4+1
        ans = [0]*(mx)
        for i in range(1, 100):
            for j in range(1, 100):
                for k in range(1, 100):
                    sm = i*i + j*j + k*k + i*j + j*k + k*i
                    if sm<mx:
                        ans[sm] += 1
        print(*ans[:n+1], sep='\n')



    
        










    




                

        

 
 
 
 
 
 
# region fastio
 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
if pypy:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
    input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# endregion
 
if __name__ == "__main__":
    if profile:
        import cProfile
        cProfile.run('main()')
    else:
        main()

Submission status: Wrong Answer

Solution code:
n=int(input())
ls=[0]*n
xyz=[1,1,1]
p=6
cnt=0
while p<=n:
  if xyz[0]==xyz[1] and xyz[0]==xyz[2]:
    ls[p-1]=1
  else:
    ls[p-1]=3
  xyz[cnt%3]+=1
  p=xyz[0]**2+xyz[1]**2+xyz[2]**2+xyz[0]*xyz[1]+xyz[1]*xyz[2]+xyz[0]*xyz[2]
for i in ls:
  print(i)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
l = list()
for i in range(31):
    l.append((i, i**2))
# print(l)
c = Counter()
for X in l:
    for Y in l:
        for Z in l:
            x = X[0]
            y = Y[0]
            z = Z[0]
            c[X[1]+Y[1]+Z[1]+x*y+y*z+x*z] += 1

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

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement
N = int(input())
ans = list(0 for _ in range(N))
for L in combinations_with_replacement(range(1, 6), 3):
  x = L[0]
  y = L[1]
  z = L[2]
  A = x**2 + y**2 + z**2 + x*y + y*z + z*x
  if A <= N:
    if x == y and y == z:
      ans[A - 1] += 1
    elif x == y or y == z or z == x:
      ans[A - 1] += 3
    else:
      ans[A - 1] += 6

for a in ans:
  print(a)

Submission status: Wrong Answer

Solution code:
def f(n):
    res = 0
    for x in range(1, 10):
        for y in range(x, 10):
            for z in range(y, 10):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
                    if x == y == z:
                        res += 1
                    elif x != y != z:
                        res += 6
                    else:
                        res += 3
    return res


N = int(input())
for i in range(1, N + 1):
    print(f(i))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np


def solve(N: int):
    F = 45
    p = [0] * (F**3)
    for x in range(1,45):
        for y in range(1,45):
            for z in range(1,45):
                p[x*x+y*y+z*z+x*y+y*z+z*x] += 1

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


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    #n = int(input())
    n = 10000
    res = [0]*(n+1)

    for i in range(1,100):
        for j in range(1,100):
            for k in range(1,100):
                tmp = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if(tmp<=n):
                    res[tmp]+=1



    for i in range(1,n+1):
        print(res[i])
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

from math import sqrt
from collections import defaultdict
ans = defaultdict(int)
k = int(sqrt(N)) + 5
for x in range(1, k):
    for y in range(1, k):
        for z in range(1, k):
            ans[x**2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1


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

Submission status: Wrong Answer

Solution code:
from math import sqrt
l = [-1]+[0]*10**4
n = int(input())
for i in range(1,int(sqrt(n))+1):
    for j in range(1,int(sqrt(n))+1):
        for k in range(1,int(sqrt(n))+1):
            ans = i**2+j**2+k**2+i*j+j*k+k*i
            if ans <= 10*4:
                l[ans] += 1
for i in range(1,n+1):
    print(l[i])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import defaultdict


def main():
    n_in = int(input().strip())

    n_to_xyz = defaultdict(set)
    for x in range(1, 70):
        for y in range(1, 70):
            for z in range(1, 70):
                n = x * x + y * y + z * z + x * y + y * z + z * x
                n_to_xyz[n].add((x, y, z))

    for i in range(1, n_in + 1):
        print(len(n_to_xyz[i]))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import itertools
import decimal
import math
import collections
import sys
#input = sys.stdin.readline
import copy

# S=(input())
# N=int(input())
# N,K=map(int,input().split())
# ListA=list(map(int,input().split()))
# ListA.sort()#reverse=True)

def resolve():
    
    N=int(input())
    ans=[0]*(N+1)
    cnt=0
    for x in range(1,35):
        for y in range(1,35):
            for z in range(1,35):
                tmp=x**2+y**2+z**2+x*y+y*z+z*x
                if(tmp<=N):
                    ans[tmp]+=1


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



resolve()

Submission status: Wrong Answer

Solution code:
def INT():
    return int(input())

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

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

N = INT()
ans = [0] * N

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

for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
import math
LI = lambda: list(map(int,input().split()) )
MI = lambda: map(int,input().split())
SI = lambda: input()
II = lambda: int(input())
n = II()
l = [0]*(n+1)
m = int(n**0.5)+1
for i in range(1,m):
    for j in range(i,m):
        for z in range(j,m):
            s = i**2+j**2+z**2+i*j+i*z+j*z
            if s>n:
                continue
            if i == j == z:
                l[s] = 1
            elif i == j or j == z or i == z:
                l[s] = 3
            else:
                l[s] = 6
for i in range(1,n+1):
    print(l[i])

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    for i in range(n):
        calc(i)

def calc(n):
    count = 0
    for x in range(1, n + 1):
        for y in range(1, n + 1):
            for z in range(1, n + 1):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
                     count += 1
    print(count)
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

cnt = [0] * n
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):
            num = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if num <= n:
                print(num)
                cnt[num - 1] += 1
print(*cnt, sep="\n")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy,deepcopy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(map(int,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)
INF = 10**9
mod = 10**9+7

N = i()
L = [0]*(10**4)
for i in range(1,101):
    x = i**2
    for j in range(1,101):
        y = j**2
        if x+y >= 1000:
            break
        for k in range(1,101):
            z = x+y+k**2+i*j+j*k+i*k
            if z <= 10**4:
                L[z-1] += 1
for i in range(N):
    print(L[i])

Submission status: Wrong Answer

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

for x in range(1,n):
    for y in range(x,n):
        for z in range(y,n):
            i=x*x + y*y + z*z + x*y + y*z + z*x
            if(i>n):
                break
            elif(x==y and y==z):
                c[x*x + y*y + z*z + x*y + y*z + z*x]+=1
            else:
                c[x*x + y*y + z*z + x*y + y*z + z*x]+=3
        j=x*x + y*y + 1 + x*y + y + x
        if(j>n):
            break
    k=x*x + 1 + 1 + x + 1 + x
    if(k>n):
        break

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