突然发现这题和省赛的线段树类型一模一样的啊,可恨早没有做In one well-known algorithm of finding thek-th order statistics we should divide all elements into groups of five consecutive elements and find the median of each five. A median is called the middle element of a sorted array (it's the third largest element for a group Read More
posted @ 2012-06-04 05:15 Because Of You Views(703) Comments(1) Diggs(0) Edit
A : 暴力枚举B:找规律,也可以用数学方法找最小的x使得 a*x%b == 0 a,b已知(a=4*n b=n+1)x是所走的圈数,易得只要把x只要等于 b/gcd(a,b) 就满足了 然后答案就是a*x/b 即a/gcd(a,b)还要加上1,因为出发前就在1的位置走了一步了 所以答案 : a/gcd(a,b)+1;B题开始太草率了,被人黑了,于是又回来看B题,有点慌,直接导致没出题,raiting掉了。C:给你一个字符矩阵,由 '#' 和 ‘.’ 组成 问你最少去掉几个'#'就能使得'#'不连通由样例可得,不管什么图,最多去掉两个'# Read More
posted @ 2012-06-04 03:54 Because Of You Views(241) Comments(0) Diggs(0) Edit