2022-02-16 13:36:26 +08:00
|
|
|
# -------------------------------
|
|
|
|
# Difficult Rocket
|
|
|
|
# Copyright © 2021-2022 by shenjackyuanjie
|
|
|
|
# All rights reserved
|
|
|
|
# -------------------------------
|
|
|
|
|
|
|
|
"""
|
|
|
|
writen by shenjackyuanjie
|
|
|
|
mail: 3695888@qq.com
|
|
|
|
github: @shenjackyuanjie
|
|
|
|
gitee: @shenjackyuanjie
|
|
|
|
"""
|
|
|
|
import cProfile
|
2022-03-22 21:18:04 +08:00
|
|
|
import time
|
2022-02-16 13:36:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
def run():
|
2022-03-22 21:18:04 +08:00
|
|
|
start_time = time.perf_counter_ns()
|
|
|
|
print(*[x for x in range(1, 100000) if sum([int(i)**len(str(x)) for i in str(x)]) == x])
|
|
|
|
print(time.perf_counter_ns() - start_time)
|
2022-02-16 13:36:26 +08:00
|
|
|
|
|
|
|
|
2022-03-22 21:18:04 +08:00
|
|
|
cProfile.run("run()")
|
2022-02-16 13:36:26 +08:00
|
|
|
|