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 keeng2008 at 2008-04-01 21:24:39 on Problem 2249
In Reply To:帮忙看看我这程序吧~~~哪儿有问题啊~~大虾帮忙 Posted by:snowfall at 2008-03-22 21:16:44
sum=n/k; 
你确定k能整除n吗.比如n=5;k=2,就不能这样除.
不能确定整除的时候,不要用除法.
如果你先全部乘的话,又会越过int取值范围.不要硬搞了,想一想处理方法吧.
Warning: Don't underestimate the problem. The result will fit into an 
integer - but if all intermediate results arising during the computation 
will also fit into an integer depends on your algorithm. The test cases will go to the limit. 

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