Blue Bridge Cup Python Group - Decomposition of Numbers
import os
import sys
def check(x):
y=str(x)
if '2' in y or '4' in y:
return 0
else:
return 1
s = 0
for i in range(1,672):
for j in range(i + 1,1009):
k = 2019 - i - j
if i < j < k and check(i) == 1 and check(j) == 1 and check(k):
s += 1
print(s)
The final answer is 40785
Thank you for your support. Your one-click three-connection is the biggest driving force for Ganggang students!