雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年10月30日

摘要: View Code #include<stdio.h>#include<math.h>long long mon(long long n,long long p,long long m){ n=n%m; long long all=1; while(p>0) { if(p&1==1) { all=(all*n)%m; } n=(n*n)%m; p>>=1; } return all;}int main(){ long long n,m; while(sca... 阅读全文

posted @ 2011-10-30 16:32 huhuuu 阅读(303) 评论(0) 推荐(0) 编辑

摘要: dp[x][y][y]=nx,y,z分别代笔三座塔德高度,n是到达该高度最多需要//ta,tb,tc为该塔最高可达高度,可以降低时间复杂度View Code #include<stdio.h>#include<string.h>int dp[121][121][121];int main(){ int n; while(scanf("%d",&n)!=EOF) { int i,x,y,z; int a=0,b=0,c=0,ta=0,tb=0,tc=0;//ta,tb,tc为该塔最高可达高度,可以降低时间复杂度 memset(dp,-1... 阅读全文

posted @ 2011-10-30 15:15 huhuuu 阅读(257) 评论(0) 推荐(0) 编辑