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

 

posted @ 2014-12-15 23:52  sbit  阅读(144)  评论(0编辑  收藏  举报