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

果真是水题,发个代码吧

Posted by 201501060326 at 2016-02-24 22:49:05 on Problem 3619
#include <stdio.h>
int init(int x,int y)
{
    if(x%y==0)
        return x/y;
    else
        return x/y+1;
}
int main()
{
    int n,k,s,t,r;
    scanf("%d%d",&n,&k);
    while(k--)
    {
        scanf("%d%d%d",&s,&t,&r);
        printf("%d\n",init(n,s)+(init(init(n,s),t)-1)*r);
    }
    return 0;
}

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