Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
快速幂才能0ms,暴力16ms#include <stdio.h> using namespace std; double pw(double a, int b){ if(b==0)return 1.0; if(b==1)return a; double p = pw(a,b/2); double r = p*p; if(b%2)return r*a; return r; } int main() { int R,M,Y; scanf("%d%d%d",&R,&M,&Y); double m = M; double r = 1+R/100.0; printf("%d\n",(int)(m*pw(r,Y))); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator