摘要: 1. (1 > 1;// 2 = 21 x = x >> 6;// 64 = 263. 数值转整数加速 10%x = int(1.232) //改为: x = 1.232 >> 0; 4. 交换两个数值(swap),使用 XOR 可以加速20%t = a; a = b; b = t;... 阅读全文
posted @ 2016-03-13 20:37 Code-dream 阅读(325) 评论(0) 推荐(0) 编辑
摘要: int lowbit(int x){ return x&-x;}int add(int pos,int a){ while (pos0) { ans+=c[pos]; pos-=lowbit(pos); } return ans;} 阅读全文
posted @ 2016-03-13 11:19 Code-dream 阅读(150) 评论(0) 推荐(0) 编辑