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 |
有BUG!In Reply To:So me wrong answer? Help! Posted by:ACM30413 at 2005-12-29 21:01:44 > #include<iostream> > using namespace std; > int main() > { > int d,s,mint,m,t,x,a; > while(cin>>t>>x){ > cin>>m; > if(m==0) cout<<t*x<<endl; > else{ > mint=100000000; > while(m--) > { > cin>>d>>s; > a=(d-1)/s; ~~~~~~~~~~~ 改为a=ceil((double)d/s); > if(mint>a) mint=a; > } > if(t==0||mint<2) cout<<0<<endl; > else if(mint>t) cout<<t*x<<endl; > else cout<<((mint-1)+(t-mint+1)/2)*x<<endl; > //cout<<mint*x<<endl; > } > } > return 0; > } > > Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator