Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:竟然是去尾进一

Posted by qianwei at 2010-07-04 19:11:54 on Problem 3619
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator