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:兄弟们啊,直接用快排,就几行代码,1782MS,水过!!!不过开始用while(gets(tree[n++])!=NULL);wa了我3次,改成while(gets(tree[n])!=NULL)n++;就ac了,为什么呀?

Posted by huanghongxun at 2012-08-25 20:34:37 on Problem 2418
In Reply To:Re:兄弟们啊,直接用快排,就几行代码,1782MS,水过!!!不过开始用while(gets(tree[n++])!=NULL);wa了我3次,改成while(gets(tree[n])!=NULL)n++;就ac了,为什么呀? Posted by:61886510 at 2012-02-06 13:13:23
while(gets(tree[n++])!=NULL);
中的n++会在最后多执行一次。
最后再n--即可。

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