摘要: Watchmen 题意:有n (1 ≤ n ≤ 200 000) 个点,问有多少个点的开平方距离与横纵坐标的绝对值之差的和相等; 即 = |xi - xj| + |yi - yj|.(|xi|, |yi| ≤ 109) 思路:开始想的是容斥原理,即按x,y分别排序,先计算同x的点,然后在计算同y的点 阅读全文
posted @ 2016-03-11 15:22 hxer 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Vasya's telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by sw 阅读全文
posted @ 2016-03-11 14:43 hxer 阅读(394) 评论(0) 推荐(0) 编辑