1089: [SCOI2003]严格n元树

好久没更新了。。于是节操掉尽python水过本来就水的题。。

1 n,d=map(int, raw_input().split())
2 if d==0:
3     print 1
4 else:
5     f=[1]
6     for i in range(0, d+1):
7         f.append(f[i]**n+1)
8     print f[d]-f[d-1]
View Code
原文地址:https://www.cnblogs.com/hzf-sbit/p/4166155.html