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 |
WA ,,why>>??#include <iostream> using namespace std; void init(); __int64 min(__int64 , __int64 , __int64 ); int a,b,c; __int64 num[1500]; int main() { int i; cin>>a>>b>>c>>i; init(); printf("%I64d\n",num[i+1]); return 0; } void init() { int p1,p2,p3; p1=p2=p3=1; num[1]=1; int p=1; while(num[p]<10e17){ p++; num[p]=min(num[p1]*a,num[p2]*b,num[p3]*c); while(num[p1]*a<=num[p]) p1++; while(num[p2]*b<=num[p]) p2++; while(num[p3]*c<=num[p]) p3++; } } __int64 min(__int64 i,__int64 j,__int64 l) { __int64 k=i<j?i:j; return k<l?k:l; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator