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

友情提示:ceiling(N/S)可以用(N+S-1)/S得到,并且K根本不用读,上代码

Posted by Eov_Second at 2016-12-11 12:19:32 on Problem 3619
main(){
  int n,s,t,r,d;
  scanf("%d%*d",&n);
  while(scanf("%d%d%d",&s,&t,&r)>0){
    d=(n+s-1)/s;
    printf("%d\n",d+(d+t-1)/t*r-r);
  }
}

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