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:
def main():
        
    import math

    N = int(input())

    for n in range(1, N + 1):
        max_itr = min(50, int(math.sqrt(n)) + 1)
        
        ans_list = []
        ans = 0
        
        for x in range(1, max_itr):
            for y in range(1, x+1):
            # for y in range(1, max_itr):

                for z in range(1, x+1):
                # for z in range(1, max_itr):

                    left_eq = x * x + y * y + z * z + x * y + y * z + z * x
                    if (left_eq == n):
                        tmp = [x, y, z]
                        tmp.sort()

                        if (tmp not in ans_list):
                            ans_len = len(set(tmp))
                            ans_list.append(tmp)

                        
                        


                        # ans += 1
                        
                            if (ans_len==3):
                                ans += 6
                            elif (ans_len == 2):
                                ans += 3
                            else:
                                ans += 1

        
        
        print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement
n=int(input())
ans=[0]*100000
list1=[]
for i in range(1,51):
    for j in range(1,51):
        for z in range(1,51):
            list1.append([i,j,z])
for i in range(len(list1)):
    x=list1[i][0]
    y=list1[i][1]
    z=list1[i][2]
    ans[(x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(x*z)-1]+=1
for i in range(n):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
n=int(input())

for i in range(1,n+1):
  count = 0
  flg = 0
  for x in range(1,150):
    for y in range(x,150):
      for z in range(y,150):
        fn = (x+y)**2 + (y+z)**2 + (z+x)**2
        if fn > 2*i:
          break
        if fn == 2*i:
          flg = 1
          if x != y and y != z and z != x:
            count = 6
          elif z == y and y == z and z == x:
            count = 1
          else:
            count = 3
          break
    if flg == 1:
      flg = 0
      break
  print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
tmp = []
for i in range(1,10):
    for j in range(1,10):
        for h in range(1,10):
            num = i*i + j*j + h*h + i*j + j*h +h*i
            tmp.append(num)
            num = 0

tmp.sort()


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

Submission status: Wrong Answer

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

for i in range(1, n + 1):
  cnt = 0
  for x in range(1, 50):
    for y in range(x, 50):
      for z in range(y, 50):
        if (x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2 == i * 2:
          if (x == y and y != z) or (x != y and y == z):
            cnt += 3
          elif x == y == z:
            cnt += 1
          else:
            cnt += 6
  ans.append(cnt)
for j in range(n):
  print(ans[j])

Submission status: Wrong Answer

Solution code:
import itertools

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

for i in range(1,N):
  output = []
  for x in range(1,i):
    for y in range(1,i):
      for z in range(1,i):
        tmp = calc(x,y,z)
        if tmp==i:
          output.append(tmp)
  print(len(output))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0]*(N+1)
RANGE = 300
for i in range(1, RANGE):
  for j in range(1, RANGE):
    if i**2 + j**2 < N:
      for k in range(1, RANGE):
        wd = i**2 + j**2 + k**2 + i*j + j*k + k*i
        if wd < N:
          #print(wd)
          #print(i, j, k)
          ans[wd] += 1
for i in range(1,N+1):
  print(ans[i])

Submission status: Wrong Answer

Solution code:
import itertools
import numpy as np

n=int(input())
lista= list(range(1,n+1,1))
list = list(map(int, lista))


for i in range(n):
  ans=0

  for a in list:
    #if a**2 >= i:break
    #else:
    
      for b in list:
        #if c**2 >= i:break
        #else:
        
          for c in list:
            #if c**2 >= i:break
            #else:
            
              if a**2 + b**2 + c**2 + a*b + b*c + c*a == i:ans+=1

  print(ans)

Submission status: Wrong Answer

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

for x in range(1, 10**2 + 1):
    for y in range(x, 10**2 + 1):
        for z in range(y, 10**2 + 1):
            cal = x*x + y*y + z*z + x*y + y*z + z*x
            ans[cal-1] = [x, y, z]

for i in range(n):
    if ans[i] == 0:
        print(ans[i])
    else:
        l = len(set(ans[i]))
        if l == 1:
            print(1)
        elif l == 2:
            print(3)
        else:
            print(6)

Submission status: Wrong Answer

Solution code:
N = int(input())

DP = [0]*(N+1)

for x in range(1,round(N**0.5)):
    for y in range(1,round(N**0.5)):
        for z in range(1,round(N**0.5)):
            hoge = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x

            if hoge <= N:
                DP[hoge] += 1
            else:
                break

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

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
l = [0]*161700
count = 0
for x in range(1,99):
    for y in range(1,99):
        for z in range(1,99):
            if x+y+z <= 100:
                tmp = (x+y+z)**2-(x*y+y*z+z*x)
                l[count] = tmp
                count+=1
            else:
                break
l = sorted(l)
C = collections.Counter(l)
for j in range(1,n+1):
    print(C[j])

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
for i in range(1, N+1):
    count = 0
    for j in range(1, int(np.sqrt(i))+2):
        for k in range(j, int(np.sqrt(i))+2):
            for l in range(k, int(np.sqrt(i))+2):
                n = j*j + k*k + l*l + j*k + k*l + l*j
                print(i, j, k, l)
                if n == i:
                    if j == k == l:
                        count += 1
                    elif j==k or k==l or l==j:
                        count += 3
                    else:
                        count += 6
    print(count)

Submission status: Wrong Answer

Solution code:
import math
N = int(input()) + 1
Nroot = int(math.sqrt(N/3))+1
for n in range(1,N):
    count = 0
    if n >= 6:
#        print(Nroot, int(math.pow(n,1/3))-1)
        for x in range(Nroot, int(math.sqrt(n/3))-1 , -1):
            for y in range(x,0,-1):
                if (x+2*y)**2 < n:
                    break
                for z in range(1,y+1):
#                    print((x + y + z)**2 - (x*y + y*z + z*x), n,x,y,z)
#                    print(x,y,z)
                    formula = (x + y + z)**2 - (x*y + y*z + z*x)
                    if formula == n:
                        if x == y and y == z:
                            count += 1
                        else:
                            count += 3
                        break

        print(count)
    else:
        print("0")

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
import itertools

N=int(input())

a = [0] * N

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

Submission status: Wrong Answer

Solution code:
import itertools
import numpy as np

n=int(input())
lista= list(range(1,n+1,1))
list = list(map(int, lista))

print(list)

for i in range(n):
  ans=0

  for a in list:
    #if a**2 >= i:break
    #else:
    
      for b in list:
        #if c**2 >= i:break
        #else:
        
          for c in list:
            #if c**2 >= i:break
            #else:
            
              if a**2 + b**2 + c**2 + a*b + b*c + c*a == i:ans+=1

  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
tmp = []
for i in range(1,10):
    for j in range(1,10):
        for h in range(1,10):
            num = i*i + j*j + h*h + i*j + j*h +h*i
            tmp.append(num)
            num = 0

tmp.sort()


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

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, axis="xyz"):
    # print(x, y, z)
    n = x**2 + y**2 + z**2 + x*y + y*z + x*z

    if n <= N:
        f[n] += 1
        if axis == "xyz":
            f = calc(x+1, y, z, f, axis="xyz")
            f = calc(x, y+1, z, f, axis="yz")
            f = calc(x, y, z+1, f, axis="z")
        elif axis == "yz":
            f = calc(x, y+1, z, f, axis="z")
            f = calc(x, y, z+1, f, axis="")
        elif axis == "z":
            f = calc(x, y, z + 1, f, axis="")
        return f
    else:
        return f

f = calc(x, y, z, f)


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

Submission status: Wrong Answer

Solution code:
import math
import sys
N = int(sys.stdin.readline())
for i in range(1,N+1):
  ans = 0
  n = math.ceil(math.sqrt(i))
  for j in range(1,n):
    wan = n - j
    for k in range(1,wan):
      n_sub = i -j*j - k*(j + k)
      if n_sub <= 0:
        break
      b = j + k
      check = ((b**2 + 4*n_sub) ** (1/2) - b)
      if check % 2 == 0:
        ans +=1
        break
  print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


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


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


import collections
import math
def main():

    n = input_int()
    ans = collections.defaultdict(set)

    for x in range(1, int(math.sqrt(n)) + 1):
        for y in range(1, int(math.sqrt(n)) + 1):
            for z in range(1, int(math.sqrt(n)) + 1):
                temp = (x ** 2) + (y ** 2) + (z ** 2) + (x * y) + (x * z) + (y * z)
                if temp < n:
                    ans[temp].add((x, y, z))

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from math import sqrt

n = int(input())
lim_n = int(sqrt(n))
result = [0] * n

for i in range(2, lim_n+1):
    for j in range(2, i+1):
        for k in range(2, j+1):
            p = i**2+j**2+k**2
            if p >= 2*n:
                continue
            if p % 2 == 1:
                continue
            if (j + k) - i <= 0:
                continue
            if i == j and j == k:
                if i  % 2 ==1:
                    continue
                result[p//2-1] = 1
            elif i != j and j != k:
                result[p//2-1] = 6
            else:
                result[p//2-1] = 3

for item in result:
    print(item)

Submission status: Wrong Answer

Solution code:
#!python3

LI = lambda: list(map(int, input().split()))

# input
N = int(input())


def main():
    for i in range(1, N + 1):
        ans = 0
        w = i
        xn = int(w ** 0.5) + 1
        for x in range(1, xn):
            w -= x * x
            if w < 0:
                break
            yn = int(w ** 0.5) + 1
            for y in range(x, yn):
                w -= y * y
                w -= x * y
                if w < 0:
                    break
                zn = int(w ** 0.5) + 1
                for z in range(y, zn):
                    v = z * (x + y + z)
                    if v == w:
                        n = len({x, y, z})                            
                        if n == 3:
                            ans += 6
                        elif n == 2:
                            ans += 3
                        else:
                            ans += 1
        print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n > 5000:
    nn = 300
else:
    nn=2
l = [int(i) for i in range(1,n//nn)]
import itertools
p_list = list(itertools.combinations_with_replacement(l, 3))
p=[]
s=[0]*100000000
for i in p_list:
    x=i[0]
    y=i[1]
    z=i[2]
    p.append((x+y+z)**2-x*y-y*z-z*x)

    if x==y and y==z and z==x:
        s[p[-1]]=1
    elif x==y or y==z or z==x:
        s[p[-1]]=3
    else:
        s[p[-1]]=6

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

Submission status: Wrong Answer

Solution code:
def calcZ(X, Y):
    global n
    b = X + Y
    c = X ** 2 + Y ** 2 + X * Y - n
    in_root = b ** 2 - 4 * c
    if in_root < 0 or not (in_root ** 0.5).is_integer():
        return 0.1
    return (-(X + Y) + int(in_root ** 0.5)) / 2


N = int(input())
print(0)
print(0)
for n in range(3, N + 1):
    ans = 0
    for x in range(1, n):
        for y in range(x, n):
            z = calcZ(x, y)
            if z >= y and z.is_integer():
                z = int(z)
                if x == y and y == z:
                    ans += 1
                elif x == y or y == z:
                    ans += 3
                else:
                    ans += 6
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
L=[0]*N
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            f=x**2+y**2+z**2+x*y+y*z+z*x
            if f<=N:
                if x==y==z:
                    L[f-1]+=1
                else:
                    if L[f-1]==0:
                        L[f-1]+=3
                    elif L[f-1]==1:
                        L[f-1]+=3
for i in range(N):
    print(L[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
tmp = []
for i in range(1,10):
    for j in range(1,10):
        for h in range(1,10):
            num = i*i + j*j + h*h + i*j + j*h +h*i
            tmp.append(num)
            num = 0

tmp.sort()


for i in range(N):
    print(tmp.count(i))

Submission status: Wrong Answer

Solution code:
n=int(input())
d=dict({i:0 for i in range(1,n+1)})
for s in range(3,101):
    for x in range(1,s+1-2):
        for y in range(1,s+1-x-1):
            z=s-x-y
            if x<y or y<z:
                continue
            v=x**2+y**2+z**2+x*y+y*z+z*x
            if not v in d:
                continue
            if x==y==z:
                d[v]+=1
            else:
                d[v]+=3
for k in d.keys():
    print(d[k])

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement
import pprint

def func(a,b,c):
  return a**2+b**2+c**2+a*b+b*c+c*a

num=list(range(1,42))
n = int(input())
p = 0
dic = {}
for i in list(combinations_with_replacement(num, 3)):
  r = func(i[0], i[1], i[2])
  l = len(list(set(i)))
  if l == 3:
    if r in dic:
      dic[r] += 6
    else:
      dic[r] = 6
  elif l == 2:
    if r in dic:
      dic[r] += 3
    else:
      dic[r] = 3
  else:
    if r in dic:
      dic[r] += 1
    else:
      dic[r] = 1
for d in range(1, n+1):
  if d in dic:
    print(dic[d])
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
import numpy as np


arr = np.zeros(100000, dtype=np.int32)

for s in range(3, 100+1):
    for x in range(1, s-2+1):
        for y in range(1, s-1+1):
            z = s - (x + y)
            if z <= 0:
                continue
            arr[s**2 - (x*y + y*z + z*x) - 1] += 1

num = int(input())
for i in range(0, num):
    print(arr[i])

Submission status: Wrong Answer

Solution code:
dp={6: 1, 11: 3, 17: 3, 18: 3, 24: 1, 25: 6, 27: 3, 33: 3, 34: 3, 35: 6, 38: 3, 43: 3, 44: 3, 45: 6, 47: 6, 51: 3, 54: 1, 55: 6, 57: 6, 58: 6, 61: 6, 66: 3, 67: 3, 68: 3, 69: 6, 71: 6, 72: 3, 73: 6, 77: 6, 81: 3, 82: 3, 83: 9, 85: 6, 86: 3, 87: 6, 89: 3, 90: 6, 95: 6, 96: 1, 97: 6, 99: 6, 100: 6, 102: 3, 103: 12, 105: 6, 108: 3, 109: 6, 113: 3, 114: 3, 115: 12, 117: 6, 118: 3, 119: 6, 121: 3, 122: 6, 123: 9, 125: 6, 129: 3, 130: 6, 131: 3, 132: 3, 133: 6, 135: 6, 136: 3, 137: 12, 139: 3, 140: 6, 141: 6, 143: 6, 145: 6, 146: 3, 147: 6, 150: 1, 151: 6, 152: 3, 153: 12, 154: 6, 157: 12, 159: 6, 161: 6, 162: 6, 163: 12, 166: 6, 169: 6, 171: 12, 172: 3, 173: 6, 175: 6, 176: 3, 177: 9, 178: 6, 179: 3, 180: 6, 181: 6, 183: 6, 185: 6, 187: 15, 188: 6, 191: 6, 193: 3, 194: 3, 195: 12, 197: 12, 198: 6, 199: 6, 201: 3, 202: 6, 203: 6, 204: 3, 205: 12, 207: 6, 209: 9, 210: 6, 213: 6, 214: 3, 215: 12, 216: 1, 217: 6, 218: 6, 219: 6, 220: 6, 223: 18, 225: 12, 227: 3, 228: 6, 229: 12, 232: 6, 233: 3, 234: 6, 235: 12, 237: 12, 241: 9, 242: 3, 243: 9, 244: 6, 245: 12, 246: 3, 247: 12, 249: 3, 250: 6, 251: 6, 253: 12, 255: 12, 257: 9, 258: 9, 261: 6, 262: 3, 263: 6, 264: 3, 265: 12, 266: 6, 267: 9, 268: 3, 269: 6, 271: 12, 272: 3, 273: 6, 274: 3, 275: 9, 276: 6, 277: 12, 278: 6, 279: 6, 281: 6, 283: 9, 284: 6, 285: 6, 287: 12, 288: 3, 289: 6, 291: 9, 292: 6, 293: 6, 294: 1, 295: 6, 297: 21, 298: 12, 299: 6, 301: 12, 303: 12, 306: 6, 307: 15, 308: 6, 310: 6, 311: 12, 313: 12, 315: 12, 319: 12, 321: 12, 322: 12, 323: 3, 324: 3, 325: 18, 326: 3, 327: 6, 328: 3, 329: 6, 330: 6, 331: 9, 332: 9, 333: 18, 335: 6, 337: 12, 339: 9, 340: 6, 342: 3, 343: 12, 344: 3, 345: 6, 346: 6, 347: 12, 348: 6, 349: 6, 353: 15, 354: 3, 355: 18, 356: 3, 357: 18, 358: 3, 359: 12, 360: 6, 361: 3, 362: 6, 363: 9, 365: 12, 367: 12, 369: 18, 370: 12, 373: 12, 374: 3, 375: 6, 377: 6, 378: 6, 379: 9, 380: 6, 383: 18, 384: 1, 385: 18, 386: 3, 387: 12, 388: 6, 389: 6, 390: 6, 391: 12, 393: 15, 394: 6, 395: 12, 396: 6, 397: 18, 400: 6, 402: 9, 403: 12, 405: 18, 407: 6, 408: 3, 409: 12, 411: 12, 412: 12, 415: 12, 417: 3, 418: 6, 419: 12, 420: 6, 421: 18, 422: 9, 423: 18, 425: 9, 426: 6, 427: 18, 429: 6, 431: 6, 432: 3, 433: 27, 434: 6, 435: 6, 436: 6, 437: 6, 438: 3, 439: 6, 441: 12, 442: 6, 443: 9, 445: 6, 447: 18, 449: 9, 450: 9, 451: 15, 452: 3, 453: 12, 454: 6, 455: 6, 456: 3, 457: 9, 458: 6, 459: 12, 460: 12, 461: 18, 463: 18, 465: 6, 466: 6, 467: 21, 468: 6, 471: 6, 472: 3, 473: 15, 474: 6, 475: 12, 476: 6, 477: 18, 481: 12, 482: 6, 483: 6, 484: 3, 485: 6, 486: 4, 487: 18, 488: 6, 489: 12, 490: 6, 491: 3, 492: 9, 493: 30, 495: 18, 497: 6, 498: 6, 499: 12, 500: 6, 501: 6, 502: 9, 503: 12, 505: 18, 506: 6, 507: 18, 509: 6, 511: 12, 513: 6, 514: 12, 515: 6, 516: 3, 517: 18, 519: 6, 520: 6, 521: 6, 522: 6, 523: 15, 524: 3, 525: 24, 527: 6, 528: 3, 529: 18, 531: 12, 532: 6, 533: 12, 534: 6, 535: 24, 537: 15, 538: 18, 539: 9, 540: 6, 543: 18, 544: 3, 545: 6, 547: 15, 548: 12, 549: 12, 550: 6, 551: 6, 553: 18, 555: 6, 556: 3, 557: 12, 559: 12, 560: 6, 561: 6, 562: 9, 563: 9, 564: 6, 565: 24, 566: 3, 567: 24, 569: 9, 570: 12, 571: 6, 572: 6, 573: 12, 575: 12, 577: 21, 578: 9, 579: 15, 580: 6, 581: 12, 582: 3, 583: 18, 584: 3, 585: 12, 586: 6, 587: 12, 588: 6, 591: 12, 593: 12, 594: 6, 595: 24, 597: 6, 598: 12, 599: 6, 600: 1, 601: 9, 602: 6, 603: 12, 604: 6, 605: 24, 607: 18, 608: 3, 609: 12, 610: 6, 611: 6, 612: 12, 613: 24, 615: 12, 616: 6, 617: 15, 618: 6, 619: 18, 621: 18, 625: 18, 626: 9, 627: 21, 628: 12, 630: 6, 631: 18, 633: 9, 634: 6, 635: 6, 636: 6, 637: 12, 639: 12, 641: 9, 642: 9, 643: 27, 644: 6, 645: 6, 646: 3, 647: 18, 648: 6, 649: 21, 650: 6, 651: 6, 652: 12, 653: 12, 655: 12, 657: 24, 658: 12, 661: 24, 662: 3, 663: 24, 664: 6, 665: 12, 666: 12, 667: 18, 671: 12, 673: 18, 674: 3, 675: 15, 676: 6, 677: 12, 678: 9, 679: 6, 681: 15, 682: 6, 683: 9, 684: 12, 685: 24, 687: 12, 688: 3, 689: 6, 690: 6, 691: 21, 692: 6, 693: 18, 694: 3, 695: 18, 697: 21, 698: 12, 699: 15, 700: 6, 701: 6, 703: 12, 704: 3, 705: 12, 706: 9, 707: 18, 708: 9, 709: 12, 710: 6, 711: 6, 712: 6, 713: 24, 715: 18, 716: 3, 717: 24, 719: 6, 720: 6, 722: 6, 723: 9, 724: 6, 725: 6, 726: 4, 727: 30, 729: 18, 730: 12, 731: 9, 732: 6, 733: 24, 735: 18, 737: 9, 738: 12, 739: 21, 740: 6, 741: 6, 742: 12, 743: 12, 745: 18, 747: 21, 748: 15, 749: 12, 751: 12, 752: 6, 753: 12, 754: 12, 755: 18, 757: 18, 759: 6, 761: 9, 762: 12, 763: 18, 764: 6, 765: 30, 769: 24, 770: 6, 771: 6, 773: 6, 774: 6, 775: 24, 778: 12, 779: 3, 780: 6, 781: 6, 783: 30, 786: 3, 787: 18, 788: 6, 789: 12, 790: 6, 792: 3, 793: 18, 795: 6, 797: 6, 799: 18, 801: 6, 802: 15, 803: 12, 805: 12, 806: 6, 807: 6, 809: 6, 810: 12, 816: 3, 817: 30, 819: 6, 820: 6, 823: 6, 825: 12, 826: 6, 827: 6, 829: 6, 834: 3, 835: 6, 837: 12, 838: 6, 839: 6, 843: 15, 849: 3, 850: 12, 853: 6, 855: 6, 859: 9, 860: 6, 863: 6, 865: 6, 873: 3, 874: 6, 875: 6, 877: 6, 882: 6, 883: 6, 885: 6, 895: 6, 897: 6, 901: 6, 902: 3, 908: 3, 909: 6, 918: 3, 919: 6, 922: 6, 935: 6, 943: 6, 945: 6, 963: 3, 969: 3, 970: 6, 997: 6}
n=int(input())
for i in range(1,n+1):
    if i in dp:print(dp[i])
    else:print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n > 5000:
    nn = 500
else:
    nn=2
l = [int(i) for i in range(1,n//nn)]
import itertools
p_list = list(itertools.combinations_with_replacement(l, 3))
p=[]
s=[0]*100000000
for i in p_list:
    x=i[0]
    y=i[1]
    z=i[2]
    p.append((x+y+z)**2-x*y-y*z-z*x)

    if x==y and y==z and z==x:
        s[p[-1]]=1
    elif x==y or y==z or z==x:
        s[p[-1]]=3
    else:
        s[p[-1]]=6

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

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

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

N = int(input())
f_list = np.zeros((N,1), dtype=int)

for x in range(1,math.floor((N//6)**0.5)+1):
  for z in range(1,math.floor(N**0.5)+1):
    for y in range(x,z+1):
      if f(x,y,z)<=N:
        #print(x,y,z,f(x,y,z))
        if((x-y)*(y-z)*(z-x)==0): # 少なくとも2つが等しい
          if(x==y and y==z):
            f_list[f(x,y,z)-1] = 1
          else:
            f_list[f(x,y,z)-1] = 3
        else:
          f_list[f(x,y,z)-1] = 6

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0] * 10001
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 range(1, n + 1):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

def ff(N):
#     print("call ff{0}".format(N))
    if N > 100:
        n = int(np.sqrt(20))+5
    else:
        n = N
    cnt = 0
    for x in range(1, n+1):
        x2 = x**2
        for y in range(1, n+1):
            y2 = y**2
            xy = x * y
            tt = x2 + y2 + xy
            if tt > n:
                break
            for z in range(1, n+1):
                num = tt + z**2 + x*z + y*z
                if N == num:
                    cnt += 1
#                elif N < num:
#                    break
    return(cnt)    
    
N = int(input())    
n = int(np.sqrt(20))+1
for i in range(1, N+1):
#     ff(i)
     print(ff(i))

Submission status: Wrong Answer

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

for i in range(1,n+1):
    for j in range(1,int(n**0.5//6)+2):
        for k in range(j,int(n**0.5//6)+3):
            for l in range(k,int(n**0.5//6)+4):
                if j**2 + k **2 + l**2 + j*k + k*l + l*j == i:
                    if j == k == l:
                        L[i-1] += 1
                    if j != k and j!=l and k!=l:
                        L[i-1] += 6
                    else:
                        L[i-1] += 3
for m in range(n):
    print(L[m])

Submission status: Wrong Answer

Solution code:
from itertools import product
from math import *

N = int(input())
pro = list(product(range(1, int(sqrt(N))), repeat=3))

for i in range(1, N+1):
    ans = 0
    for j in range(len(pro)):
        x = pro[j][0]; y = pro[j][1]; z = pro[j][2]
        if x*x + y*y + z*z + x*y + y*z + z*x == i:
            ans += 1
    print(ans)

print(pro, len(pro))

Submission status: Wrong Answer

Solution code:
n=int(input())
d={}
sm=3
a=1
brk=0
ll=[]

while 1:  
  we=sm-a
  for i in range(1,we):
    c=we-i
    b=i
    temp=pow((a+b+c),2)-(a*b+a*c+b*c)
    if temp not in d:
      d[temp]=1
      ll.append(temp)
    else:
      d[temp]+=1
    brk=max(brk,temp)
  if brk>n and a>=sm-2:
    break
  if we==2:
    sm+=1
    a=1
  else:
    a+=1
  
#print(d)
l=[0]*n
ll.sort()
for i in ll:
  if i-1>n:
    break
  else:
    l[i-1]=d[i]
#print(ll)
for i in l:
  print(i)

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())

ans = {}
for v in itertools.combinations_with_replacement(range(1,(N//6)+1), 3):
    x,y,z = v
    fn = x**2 + y**2 + z**2 + x*y + y*z + z*x
    count = 3 if x == y == z else 1
    if fn in ans.keys():
        ans[fn] += count
    else:
        ans[fn] = count

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

Submission status: Wrong Answer

Solution code:


a={}
b=[]
for i in range(1,91):
    for j in range(i,91):
        for k in range(j,91):
            n=i*i+j*j+k*k+i*j+i*k+j*k

            if n not in a:
                if i==j and j==k:
                    a[n]=1
                elif i==j or j==k or i==k:
                    a[n]=3
                else:
                    a[n]=6
            else:
                if i==j and j==k:
                    a[n]+=1
                elif i==j or j==k or i==k:
                    a[n]+=3
                else:
                    a[n]+=6

t=int(input())
for i in range(1,t+1):
    if i in a:
        print(a[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
from numba import jit
nn = int(input())


@jit
def aa(nn):
    max_num = 50
    ans_L = []
    for n in range(1,nn+1):
        ans = 0
        for x in range(1,max_num):
            for y in range(1,max_num):
                for z in range(1,max_num):
                    if x**2 + y**2 + z**2 + x*y + y*z + x*z == n:
                        ans += 1

        ans_L.append(ans)
    return ans_L

ans_L = aa(nn)
for i in ans_L:
    print(i)

Submission status: Wrong Answer

Solution code:

n = int(input())

for i in range(n):
    count = 0
    for x in range(1,i//3+1):
        for y in range(1, i//3+1):
            for z in range(1,i//3+1):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x > i:
                    break
                elif x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == i:
                    count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

DP = [0]*(N)

for x in range(1,round(N**0.5)):
    for y in range(1,round(N**0.5)):
        for z in range(1,round(N**0.5)):
            hoge = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x - 1

            if hoge <= N:
                DP[hoge-1] += 1
            else:
                break

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

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
f = [0] * (10**4 + 1)
K = 60

flg = 1
for i in range(1, K):
    for j in range(1, K):
        for k in range(1, K):
            r = ((i + j) ** 2 + (k + j) ** 2 + (i + k) ** 2)//2
            if r > 10**4:
                flg = 0
                break
            prm = list(itertools.combinations([i, j, k], 3))
            if r <= 10**4:
                f[r] += 1

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


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


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


import collections
def main():

    n = input_int()
    ans = collections.defaultdict(set)

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    f = [0] * (N+1)

    for x in range(1, 41):
        for y in range(x, 42):
            for z in range(y, 42):
                if (ans := (x+y+z)**2 - x*y - y*z - z*x) in range(1, N+1):
                    count = 0
                    if x == y and y == z:
                        count = 1
                    elif x != y and y != z and z != x:
                        count = 6
                    else:
                        count = 3
                    f[ans] += count
    
    for i in range(1, N+1):
        print(f[i])




def input_ints():
    line_list = input().split()

    if len(line_list) == 1:
        return int(line_list[0])
    else:
        return map(int, line_list)


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


def input_int_tuple_list(n: int):
    return [tuple(map(int, input().split())) for _ in range(n)]


main()