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 wi at 2006-04-08 18:13:23 on Problem 1745
原来,是负数的余数没处理好。
最初我想的是要把负数的余数表示为正,就得加上除数K,图简便就写成了:
d=(d+k)%k;
孰不知,当d<-k时,这样的结果还是负数,
而我在自己验证数据时一直都没用过小于-k的数据,还以为都正确呢~
惭愧,惭愧~

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