You are viewing a single comment's thread. Return to all comments →
n=int(input()) l={0} for i in range(2,n+1): for j in range(2,n+1): l.add(pow(i,j)) print(len(l)-1)
problem on this code why it fail in many test cases
Project Euler #29: Distinct powers
You are viewing a single comment's thread. Return to all comments →
n=int(input()) l={0} for i in range(2,n+1): for j in range(2,n+1): l.add(pow(i,j))
print(len(l)-1)
problem on this code why it fail in many test cases