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:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

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

def Main():
    n = I()
    c = [0]*n
    fa = fb = True
    for i in range(1,n+1):
        tmp = f(i,i,i)
        if n<tmp:  fa=False
        if fa:
            c[tmp-1] += 1

        for j in range(1,n+1):
            if i==j:    continue
            tmp = f(i,i,j)
            if n<tmp:   
                fb = False
                break
            c[tmp-1] += 3
        if not fa and not fb:
            break

    for i in c:
        print(i)
    return

if __name__=='__main__':
    Main()

Submission status: Wrong Answer

Solution code:
a, b = 1, 1
N = int(input())
test = (a ** 2) * 3 + b ** 2 + a * b * 2
hoge = 2
for i in range(1, N + 1):
    x = 0
    while True:

        if test == i:
            if a == b:
                x += 1
            else:
                x += 3
            if b - 1 <= 1:
                hoge += 1
                b = hoge - 1
                a = 1
            else:
                b -= 1
                a += 1
            test = (a ** 2) * 3 + b ** 2 + a * b * 2
        else:
            print(x)
            break

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = [0 for i in range(n)]
for i in range(1,105):
    for j in range(i,105):
        for k in range(j,105):
            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:
import itertools
n = int(input())
N = 1
while N**2 < n:
    N += 1
ans = [0] * n

for x,y,z in itertools.combinations_with_replacement(list(range(1,N+1)), 3):
    a = x**2+y**2+z**2 + x*y+y*z+z*x
    if a > n: continue
    if x==y==z: b = 1
    elif x==y or x==z or y==z: b = 3
    else: b = 6
    ans[a-1] = b

for i in ans: print(i)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

for i in range(N):
  n = i+1
  pair = []
  mmax = int(math.sqrt(N)) + 1
  for x in range(1, mmax+2):
    for y in range(x, mmax+3-x**2):
      for z in reversed(range(y, mmax+4-x**2-y**2)):
        if x**2+y**2+z**2+x*y+y*z+z*x == n:
          pair.append((x, y, z))
  ans = 0
  for x, y, z in pair:
    if x == z:
      ans += 1
    elif x == y:
      ans += 3
    elif y == z:
      ans += 3
    else:
      ans += 6
  print(ans)

Submission status: Wrong Answer

Solution code:
import sys

def f(x, y, z):
    return x*x + y*y + z*z + x*y + y*z + z*x
N = int(input())

ans = {}
for x in range(1, 100):
    for y in range(1, x+1):
        for z in range(1, y+1):
            ret = f(x, y, z)
            if ret <= N:
                if x == y and y == z:
                    ans[ret] = 1
                elif x != y and y != z and z != x:
                    ans[ret] = 6
                else:
                    ans[ret] = 3

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

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))


def solve(n):
    result = [0] * n
    for i in range(1, n+1):
        i2 = pow(i, 2)
        for j in range(i, n+1):
            j2 = pow(j, 2)
            for k in range(j, n+1):
                # print((i, j, k))
                k2 = pow(k, 2)
                curr = i2 + j2 + k2 + i*j + i*k + j*k
                if curr > n:
                    break
                count = 1 if i == j and i == k else 3
                result[curr-1] += count
    return result


if __name__ == "__main__":
    n = int_in()
    result = solve(n)
    for item in result:
        out(item)

Submission status: Wrong Answer

Solution code:
N = int(input())

def Main(N):
    B = 43
    ans = [0]*(6*B*B+10)
    for i in range(1, B+1):
        for j in range(1, B+1):
            for k in range(1, B+1):
                a = i*i+j*j+k*k+i*j+j*k+k*i
                ans[a] += 1
    return ans

            
        
                    
out = Main(N)
for i in range(1, N+1):
    print(out[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
for n in range(1,N+1):
    a=n/6

    saidai=int(a**0.5)+1
    answer=0
    for z in range(1,saidai+1):
        if 3+z**2+2*z>n:
            break
        for y in range(1,z+1):
            if y**2+z**2+1+y+z+y*z>n:
                break
            for x in range(1,y+1):
                if x**2+y**2+z**2+x*y+y*z+z*x==n:
                    if x==y==z:
                        answer+=1
                        break
                    elif x==y or y==z or z==x:
                        answer+=3
                        break
                    else:
                        answer+=6
                        break
    print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())


# 10000 ということはxが100 or yが100 or zが100で超える
# 正確にはルートn以下まで実施すれば良い

l = [0] * 10001
for i in range(1,n+1):
    tmp = 0
    for x in range(1,n+1):
        if x*x > 100:
            break
        for y in range(1,n+1):
            if y*y > 100:
                break
            for z in range(1,n+1):
                if z*z > 100:
                    break
                if x*x+y*y+z*z+x*y+y*z+z*x == i:
                    tmp += 1
    l[i] = tmp

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

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement
N = int(input())
box = []
for i in range(1, 101):
    box.append(i)

temp = []

for cr in combinations_with_replacement(box, 3):
    st = set()
    x, y, z = cr
    st.add(x)
    st.add(y)
    st.add(z)
    if len(st) == 2:
        temp.append([x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x, 3])
    else:
        temp.append([x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x, 1])
temp = sorted(temp, reverse=True)

for i in range(1, N+1):
    ans = 0
    while temp[-1][0] == i:
        ans += temp[-1][1]
        temp.pop()
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    if n == 1:
        print(0)
        sys.exit()
    r = [0]*100000000
    for i1 in range(1,33):
        for i2 in range(1,33):
            for i3 in range(1,33):
                t = i1**2 + i2**2 + i3**2 + i1*i2 + i2*i3 + i1*i3
                r[t] += 1
    for i1 in range(1, n+1):
        print(r[i1])

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


n = int(readline())
# n = 1700 ** 0.5
# print(n)

l = [0]*(10**5)
for x in range(1, 50):
    for y in range(1, 50):
        for z in range(1, 50):
            i = x ** 2 + y ** 2 + z ** 2 + x*y + y*z + z*x
            l[i] += 1

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

ans = 0

for i in range(1,n+1):
  r = math.floor(math.sqrt(i))
  for x in range(1,r+1):
    for y in range(x,r+1):
      for z in range(y,r+1):
        if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
          if x == y and y == z:
            ans += 1
          elif x == y or y == z or z == x:
            ans += 3
          else:
            ans += 6
  print(i,ans)
  ans = 0

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt = 0
for n in range(1,N+1):
    for x in range(1,n+1):
        for y in range(1, n+1):
            if x**2 + y**2 + (N-x-y)**2 + x*y + y*(n-x-y) + (n-x-y)*x == n:
                cnt +=1
    print(cnt)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

for i in range(1,N+1):
  ans = 0
  x,y,z, = 1,1,1
  for x in range(1,int(math.sqrt(i))):
    if x**2 + x**2 + x**2 + x*x + x*x + x*x > i:
      break
    for y in range(x,int(math.sqrt(i))):
      if x**2 + y**2 + y**2 + x*y + y*y + y*x > i:
        break
      for z in range(y,int(math.sqrt(i))):
        if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
          if x == y == z:
            ans += 1
          elif x == y | x == z | y == z:
            ans += 2
          else:
            ans += 3
          break
        elif x**2 + y**2 + z**2 + x*y + y*z + z*x > i:
          break
      
  print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
n = int(input())
for i in range(1, n + 1):
    ans = 0
    for a in range(1, 32):
        for b in range(a, 32):
            for c in range(b, 32):
                if a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a == i:
                    if a < b and b < c:
                        ans += 6
                    elif a == b and b < c:
                        ans += 3
                    elif a < b and b == c:
                        ans += 3
                    else:
                        ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import product

N = int(input())

cnt = [0]*10000000

for x in range(1,51):
    for y in range(1,51):
        for z in range(1,51):
            cnt[x**2 + y**2 + z**2 + x*y + y*z + z*x -1] += 1

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

Submission status: Wrong Answer

Solution code:
n = [0 for i in range(10001)]
for z in range(1, 59, 1):
    for y in range(1, 59, 1):
        for x in range(1, 59, 1):
            tmp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if tmp > 10 ** 4:
                break
            else:
                n[tmp] += 1
N = int(input())
for i in range(1, N+1, 1):
    print(n[i])

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[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):
            i=(x+y+z)**2-(x*y+y*z+x*z)
            if i<n:
                l[i-1]+=1
print(*l,sep="\n")

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
mul=1
while ans<=N:
    ans=6*(mul**2)
    mul+=1
ANS={}
for i in range(1,mul+1):
    for j in range(i,mul+1):
        for k in range(j,mul+1):
            if i!=j and j!=k:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=6
            elif i==j and j==k:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=1
            else:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=3
for i in range(1,N+1):
    if i in ANS.keys():
        print(ANS[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())

N_MAX = 10 ** 4
cnt = [0] * (N_MAX + 1)
for x in range(1, N + 1):
    if x ** 2 + 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):
            a = (x + y + z) ** 2 - x * y - y * z - x * z
            if a > N_MAX:
                break
            cnt[a] += 1 if x == y and y == z else 3

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

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[0]*n
for i in range(3,int(n**0.5+2)):
  for j in range(1,i-1):
    for k in range(1,i-j):
      if (x:=i*i-j*k-k*(l:=i-j-k)-l*j)<=n:
        A[x-1]+=1
for a in A:
  print(a)

Submission status: Wrong Answer

Solution code:
def f(n):
    res = 0
    for x in range(1, 100):
        for y in range(x, 100):
            if 4 * n - 3 * (x + y) ** 2 + 4 * x * y < 0:
                return None
            for z in range(y, 100):
                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())
skip = False
for i in range(1, N + 1):
    if not skip:
        temp = f(i)
        if temp is not None:
            print(temp)
        else:
            skip = True
            print(0)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=[0]*N
for x in range(1,14):
    if 6*(x**2)>N:
        break
    for y in range(x,20):
        if (x**2)+3*(y**2)+(2*x*y)>N:
            break
        for z in range(y,30):
            a=x**2+y**2+z**2+x*y+y*z+z*x
            if 1<=a<=N:
                if x==y==z:
                    ans[a-1]+=1
                elif x==y or y==z:
                    ans[a-1]+=3
                else:
                    ans[a-1]+=6
for i in range(N):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
N=int(input())

ans=0
for i in range(1,N):
    for j in range(1,N):
        for k in range(1,N):
            for l in range(1,N):
                if l**2+j**2+k**2+l*j+j*k+k*l==i:
                    ans+=1
    print(ans)
    ans=0

Submission status: Wrong Answer

Solution code:
#coding: UTF-8
import math
N = int(input())
#print(N)

for i in range(5):
  print(0)

for i in range(6,N+1):
  cnt = 0
  m = int(math.sqrt(i))
  #平方根までやればよい
  for x in range(1,m):
    for y in range(1,m):
      for z in range(1,m):
        a = (x+y+z)**2 -x*y -y*z - z*x
        if a == i:
          cnt += 1
  print(cnt)

Submission status: Wrong Answer

Solution code:
import sys


def f(i):
    ans = 0
    for x in range(1, 32):
        for y in range(x, 32):
            for z in range(y, 32):
                n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if i == n:
                    a = len(set((x, y, z)))
                    if a == 1:
                        ans += 1
                    elif a == 2:
                        ans += 3
                    elif a == 3:
                        ans += 6
                    else:
                        raise ValueError()
                    break
                elif i < n:
                    break

    return ans

def resolve(in_):
    n = int(in_.readline())
    for i in range(1, n):
        yield f(i)



def main():
    for answer in resolve(sys.stdin.buffer):
        print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

keys = [i for i in range(1, N+1)]
values = [0] * N
count_dict = dict(zip(keys, values))

for x in range(1, N//6+1):
    for y in range(x, N//6+1):
        for z in range(y, N//6+1):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n > N:
                break
            count_dict[n] += 3
            if x == y and y == z:
                count_dict[n] -= 2

for v in count_dict.values():
    print(v)

Submission status: Wrong Answer

Solution code:
N = 20
x,y,z = [0,0,0]

for i in range(1,N+1):
    ans = 0
    if i < 6:
        print(0)
        continue
    for j in range(1,int(i**0.5)+1):
        for k in range(1,int(i**0.5)+1):
            for m in range(1,int(i**0.5)+1):
                if j**2 + k**2 + m**2 +j*k + j*m + m*k == i:
                    ans += 1
    print(ans)

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())

cnt = [0] * pow(10, 5)
for x in range(1, 50):
    for y in range(1, 50):
        for z in range(1, 50):
            acc = x * x + y * y + z * z + x * y + y * z + x * z
            cnt[acc] += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n=30000
l=[0 for i in range(n)]
for i in range(2,101):
    for j in range(i,101):
        for k in range(j,101):
            if ((i+j+k)/2>i and (i+j+k)/2>j and (i+j+k)/2>k and (i**2+j**2+k**2)//2==(i**2+j**2+k**2)/2):              
                if i==j==k:
                    l[(i**2+j**2+k**2)//2-1]+=1
                elif (i==j or j==k or k==i):
                    l[(i**2+j**2+k**2)//2-1]+=3
                else:
                    l[(i**2+j**2+k**2)//2-1]+=6

n=int(input())
for i in l[:n]:
    print(i)

Submission status: Wrong Answer

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

enter = int(math.sqrt(N))
value_array = []
for x in range(7, enter+1):
  for y in range(7, enter+1):
    for z in range(7, enter+1):
      value_array.append(x**2 + y **2 + z ** 2 + x*y + y*z + z*x)

for i in range(1, N+1):
  print(value_array.count(i))

Submission status: Wrong Answer

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

for x in range(1,n+1):
    for y in range(x,n+1):
        for z in range(y,n+1):
            i=x*x + y*y + z*z + x*y + y*z + z*x
            if(i>n):
                break
            elif(x==y and y==z and z==x):
#                print(x,y,z,i)
                c[i]+=1
            else:
#                print(x,y,z,i)
                c[i]+=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])

Submission status: Wrong Answer

Solution code:
N = int(input())
record = [0] * 1000000

for i in range(1,N):
    for j in range(1,N):
        sum = i**2 + i**2 + j**2 + i*i + i*j +j*i
        if sum >= N: break
        # print(i,j)
        record[sum] += 3

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

Submission status: Wrong Answer

Solution code:
N = int(input())

answers = [0 for i in range(10**4+1)]


for x in range(1,50):
    for y in range(x,50):
        for z in range(y,50):
            n = x**2+y**2+z**2+x*y+y*z+z*x
            if 0 <= n <= 10000:
                #print(x,y,z,n)
                c = len(set([x,y,z]))
                if c == 1:
                    answers[n] += 1
                elif c == 2:
                    answers[n] += 3
                else:
                    answers[n] += 6
                

#print(answers[:30])

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[0]*100000
for x in range(1,101):
  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: Wrong Answer

Solution code:
def f(n):
  count = 0
  for i in range(n+1):
    for j in range(n+1):
      for l in range(n+1):
        if (i+j)**2 + (j+l)**2 + (l+i)**2 == 2*n:
          count += 1
  return (count)
n = int(input())
for i in range(n+1):
  f(i)

Submission status: Wrong Answer

Solution code:
N = int(input())

res = [0] * N


for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            t1 = (x + y + z) ** 2

            if t1 > 11000:
                break

            n = t1 - x * y - y * z - z * x - 1
            
            if n >= N:
                break
            res[n] += 1

for o in res:
    print(o)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())

x, y, z = 1, 1, 1

f = [0] * (N+1)
# while x**2 + y**2 + z**2 + x*y + y*z + x*z <= N:
def calc(x, y, z, f):
    # print(x, y, z)
    n = x**2 + y**2 + z**2 + x*y + y*z + x*z
    if n <= N:
        f[n] += 1
    return f


while True:
    f = calc(x, y, z, f)
    f = calc(x+1, y, z, f)
    f = calc(x, y+1, z, f)
    f = calc(x, y, z+1, f)
    f = calc(x+1, y+1, z, f)
    f = calc(x, y+1, z+1, f)
    f = calc(x+1, y, z+1, f)

    x += 1
    y += 1
    z += 1

    if x**2 + y**2 + z**2 + x*y + y*z + x*z > N:
        break

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

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
mul=1
while ans<=N:
    ans=6*(mul**2)
    mul+=1
ANS={}
for i in range(1,mul+1):
    for j in range(i,mul+1):
        for k in range(j,mul+1):
            if i!=j and j!=k:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=6
            elif i==j and j==k:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=1
            else:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=3
for i in range(N+1):
    if i in ANS.keys():
        print(ANS[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

L = [0] * (N + 1)
thre =  ceil(sqrt(N/6)) + 1
# print(thre)
for x in range(1, thre+1):
    for y in range(1, thre + 1):
        for z in range(1, thre + 1):
            if f(x,y,z) < N:
                L[f(x, y, z)] += 1
print(*L[1:], sep="\n")

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    if n == 1:
        print(0)
        sys.exit()
    r = [0]*100000000
    for i1 in range(1,32):
        for i2 in range(1,32):
            for i3 in range(1,32):
                t = i1**2 + i2**2 + i3**2 + i1*i2 + i2*i3 + i1*i3
                r[t] += 1
    for i1 in range(1, n+1):
        print(r[i1])

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
ans_list = []

for x in range(1, 9):
    for y in range(1, 9):
        for z in range(1, 9):
            tmp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if tmp <= 100:
                ans_list.append(tmp)

N = int(input())

ans_list = sorted(ans_list)
ans_set = set(ans_list)

for i in range(1, N + 1):
    if i in ans_set:
        print(ans_list.count(i))
    else:
        print(0)

Submission status: Wrong Answer

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


n = int(readline())
# n = 1700 ** 0.5
# print(n)

l = [0]*(10**4+10)
for x in range(1, 41):
    for y in range(1, 41):
        for z in range(1, 41):
            i = x ** 2 + y ** 2 + z ** 2 + x*y + y*z + z*x
            l[i] += 1

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

Submission status: Wrong Answer

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

enter = int(math.sqrt(N))
value_array = []
for x in range(7, enter):
  for y in range(7, enter):
    for z in range(7, enter):
      value_array.append(x**2 + y **2 + z ** 2 + x*y + y*z + z*x)

for i in range(1, N+1):
  print(value_array.count(i))

Submission status: Wrong Answer

Solution code:

n=30000
l=[0 for i in range(n)]
for i in range(2,101):
    for j in range(i,101):
        for k in range(j,101):
            if ((i+j+k)/2>i and (i+j+k)/2>j and (i+j+k)/2>k and (i**2+j**2+k**2)//2==(i**2+j**2+k**2)/2):              
                if i==j==k:
                    l[(i**2+j**2+k**2)//2-1]+=1
                elif (i==j or j==k or k==i):
                    l[(i**2+j**2+k**2)//2-1]+=3
                else:
                    l[(i**2+j**2+k**2)//2-1]+=6

n=int(input())
for i in l[:20]:
    print(i)

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(res)

Submission status: Wrong Answer

Solution code:
n = int(input())


# 10000 ということはxが100 or yが100 or zが100で超える
# 正確にはルートn以下まで実施すれば良い

l = [0] * 10001
for i in range(1,n+1):
    tmp = 0
    for x in range(1,n):
        if x*x > 100:
            break
        for y in range(1,n):
            if y*y > 100:
                break
            for z in range(1,n):
                if z*z > 100:
                    break
                if x*x+y*y+z*z+x*y+y*z+z*x == i:
                    tmp += 1
    l[i] = tmp

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

Submission status: Wrong Answer

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[:n + 1])

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
arr = [0]*N
rtN = int(math.sqrt(N))
for x in range(rtN)[1:]:
    for y in range(rtN)[x:]:
        for z in range(rtN)[y:]:
            r = (x+y+z)**2-(x*y+y*z+z*x)
            if r < N:
                if (x==z):
                    arr[r-1] +=1
                elif(x==y or y==z):
                    arr[r-1] +=3
                else:
                    arr[r-1] +=6
for ar in arr:
	print(ar)