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 |
各位大哥大姐帮忙看看哪错了,N次WA了!!!!!#include"iostream" using namespace std; int main() { _int64 a[10000]={1},p1,p2,p3,this1,this2,this3; int pp1,pp2,pp3; int n; scanf("%I64d %I64d %I64d %I64d",&p1,&p2,&p3,&n); //printf("%I64d %I64d %I64d %d",p1,p2,p3,n); pp1=pp2=pp3=0; for(int i=1;i<=n;i++) { this1=a[pp1]*p1; this2=a[pp2]*p2; this3=a[pp3]*p3; _int64 min=((this1<=this2?this1:this2)<=this3)?(this1<=this2?this1:this2):this3; a[i]=min; if(this1==min) pp1++; if(this2==min) pp2++; if(this3==min) pp3++; //printf("%I64d\n",a[i]); } printf("%I64d\n",a[n]); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator