Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
上面的那个y只遍历了一次,肯定出错了。In Reply To:请问这两段代码有何区别?(注释的和未注释的,一份ac,一份wa) Posted by:Christole at 2010-06-12 15:15:57 > > void modify(int x,int y,int delta){//这两段程序有区别?,为这个我错了2个小时!!!求教,这二者的区别!!! > int i,j,k; > /* for (;x<=n;x+=lowbit(x)) > for (;y<=n;y+=lowbit(y)) > tree[x][y]+=delta; > */ > for (i=x;i<=n;i+=lowbit(i)) > for (j=y;j<=n;j+=lowbit(j)) > tree[i][j]+=delta; > > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator