非严格\(n\)元树很好求
严格\(n\)元树就是非严格\(n\)元树减非严格\(n-1\)元树
要写高精度。。python大法好!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# <1089.py> - Sat Mar 11 20:04:58 2017 # This file is created by XuYike manually. # Copyright (C) 2015 ChangJun High School, Inc. # I don't know what this program is. n,d=map(int, raw_input().split()) f=1 g=0 i=1 while i<=d: g=f f=g**n+1 i+=1 print f-g |