摘要: 题目链接DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 1 (if there is one) such that the prefix of S with length i can be written as AK ,th. 阅读全文
posted @ 2013-04-06 14:57 xindoo 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 题目链接DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star. Astronomers want to know the distribution of the 阅读全文
posted @ 2013-04-06 10:10 xindoo 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目链接DescriptionN (2 #include #include #define maxn 8005using namespace std;int a[maxn];int ans[maxn];int n;int lowbit(int x){ return x&(-x);}void add(int x, int v){ while (x 0) { s += a[x]; x -= lowbit(x); } return s;}int binarysearch(int l, int r, int x){ if (l == r... 阅读全文
posted @ 2013-04-06 09:57 xindoo 阅读(160) 评论(0) 推荐(0) 编辑