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

POJ的评测机未免也太狠了

Posted by info___tion at 2019-05-14 14:14:22 on Problem 2528
这是我线段树单点查询的代码:

int ask(int pos,int index)
{
	if( l(index)==r(index) ) return sum(index);
	pushdown(index);
	
	int mid=( l(index)+r(index) )>>1;
	
	if(pos<=mid) ask(pos,index<<1);
	else ask(pos,index<<1|1);
}

有没有发现if_else那里少了return。

结果这样的程序居然AC了?

搞得我在UVA RE了三页……

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