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 |
Re:竟然是去尾进一In Reply To:竟然是去尾进一 Posted by:qianwei at 2010-07-04 19:10:22 #include <iostream> using namespace std; int main() { int N,K,Si,Ti,Ri; cin>>N>>K; while(K--) { cin>>Si>>Ti>>Ri; if(N%(Si*Ti)==0)cout<<((Ti+Ri)*(N/(Si*Ti))-Ri)<<endl; else cout<<((Ti+Ri)*(N/(Si*Ti))+((int)((N%(Si*Ti))/(Si*1.0)+0.99999)))<<endl; } } 括号有些多 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator