1089: [SCOI2003]严格n元树

很久没更新了。。因而节操掉尽python水过原本就水的题。。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
相关文章
相关标签/搜索