题目地址:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1553#include #include #include using namespace std;int main(){ long long int a[10005],n,k; ...
分类:
其他好文 时间:
2015-04-16 21:36:35
阅读次数:
99
先用ST预处理一下,做到可以O(1)得到[l,r]最值 然后枚举块的长度,在枚举每个块,这样的复杂度就是n/1+n/2+n/3+...+n/n n有20W,这个前面这个式子的值差不多又240W,复杂度可以接受。。 另外一开始想到一个做法,二分答案,但是经证实这样的的确确是错的 1 #i...
分类:
其他好文 时间:
2015-04-15 00:52:08
阅读次数:
138
DescriptionNow ,there are some rectangles. The area of these rectangles is 1* x or 2 * x ,and now you need find a big enough rectangle( 2 * m) so that...
分类:
其他好文 时间:
2015-04-14 23:10:48
阅读次数:
143
DescriptionFor sequence i1, i2, i3, … , iN, we set aj to be the number of members in the sequence which are prior to j and greater to j at the same ti...
分类:
其他好文 时间:
2015-04-13 20:49:57
阅读次数:
108
Description
American Carnival Makers Inc. (ACM) has a long history of designing rides and attractions. One of their more popular attractions is a fun house that includes a room of mirrors. Their ...
分类:
其他好文 时间:
2015-04-07 17:48:42
阅读次数:
175
Description
A word cloud (or tag cloud) is a visual representation of textual data based on a weighted metric. In the above cloud (which is based on this year's list of Mid-Central teams), the fo...
分类:
其他好文 时间:
2015-04-07 17:45:51
阅读次数:
163
Description
An anagram of a string is any string that can be formed using the same letters as the original. (We consider the original string an anagram of itself as well.) For example, the string...
分类:
其他好文 时间:
2015-04-07 17:45:41
阅读次数:
114
Description
The Maze Makers is a publisher of puzzle books. One of their most popular series is maze books. They have a program that generates rectangular two-dimensional mazes like the one shown...
分类:
其他好文 时间:
2015-04-07 17:43:08
阅读次数:
156
【题意】
给定序列q[1..n],求任意两数异或的最大值
数据范围:1
【分析】Trie用来从高到低保存0和1,然后爆搜:尽可能凑1,不然凑0
【代码】
WOC为什么是多组数据?
#include
#include
#include
using namespace std;
const int K=32;
const int L=3300000;
typedef long...
分类:
其他好文 时间:
2015-04-06 23:16:51
阅读次数:
178
题目链接:点击打开链接
题意:
给出逆序数的值,求原序列(一个1-N的排列)
1, 2, 0, 1, 0 表示1的逆序数是1,2的逆序数是2,3的逆序数是0···
思路:
从最后一个数开始插,每次插到当前序列的第a[i]个数。。
splay模拟
== 这个方法比较直(wu)观(nao),别的方法并没有想出来。。
#include
#includ...
分类:
其他好文 时间:
2015-04-05 23:37:42
阅读次数:
550