DZY has a sequence a, consisting of
n integers.
We'll call a sequence ai,?ai?+?1,?...,?aj
(1?≤?i?≤?j?≤?n) a subsegment of the sequence
a. The value (j?-?i?+?1) denotes the length of the subsegmen...
分类:
其他好文 时间:
2014-09-16 15:57:40
阅读次数:
248
题意:给你一个数组a,降序排序后,求sum+=0.95^(i-1)*ai 这题wa了两发,因为我没看清题意,要排序! 精度上面通过a^(i-1)=e^((i-1)*log(a)) 提到精度,就要想到底数 代码 1 #include "stdio.h" 2 #include "string.h" 3....
分类:
其他好文 时间:
2014-09-16 12:24:40
阅读次数:
196
一、AI文件结构说明AI文件整体结构类似于PDF结构,主要由开头描述部分、间接对象、交叉索引表、文件尾部组成,主要结构如下图1所示,其中交叉索引表保存了所有obj在文件中的偏移地址,所有数据信息都保存在obj中,每个obj对象都类似于下面结构:1 0 obj 数据 endobj ,交叉索引表以单.....
分类:
其他好文 时间:
2014-09-16 10:31:30
阅读次数:
312
当时想到了贪心,但是不知为何举出了反列。。。。我是逗比,看了点击打开链接。才发现我是逗比。
Problem Description
There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:
● ai ∈ [0,n]
●...
分类:
其他好文 时间:
2014-09-16 02:44:19
阅读次数:
276
题目链接:hdu 5014 Number Sequence
题目大意:给定n,表示有0~n这n+1个数组成的序列a,要求构造一个序列b,同样是由0~n组成,要求∑ai⊕bi尽量大。
解题思路:贪心构造,对于n来说,找到n对应二进制的取反对应的数x,那么从x~n之间的数即可两两对应,然后x-1即是一个子问题。
#include
#include
#include
using n...
分类:
其他好文 时间:
2014-09-15 21:25:59
阅读次数:
207
Problem Description
There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:
● ai ∈ [0,n]
● ai ≠ aj( i ≠ j )
For sequence a and sequence b,...
分类:
其他好文 时间:
2014-09-15 21:22:10
阅读次数:
240
思路:既然是求两个数的异或运算之和,且由于数字不重复,那么肯定两个数异或的结果数字越大越好,即异或后从ai二进制的最高位后全是1。具体思路看代码:AC代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using nam...
分类:
其他好文 时间:
2014-09-15 12:54:28
阅读次数:
198
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5014题目大意:给定数组 a[]={0,1,2......n} 求一个数组b[] 元素也为0.....n 但顺序与a[]不同使得sum(ai ^ bi)最大注意到2^k =100000(k个0) 2^k-...
分类:
其他好文 时间:
2014-09-15 12:37:58
阅读次数:
179
Problem Description
There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:
● ai ∈ [0,n]
● ai ≠ aj( i ≠ j )
For sequence a and sequence b,...
分类:
其他好文 时间:
2014-09-15 01:06:27
阅读次数:
175
Problem Description
There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:
● ai ∈ [0,n]
● ai ≠ aj( i ≠ j )
For sequence a and sequence b, t...
分类:
其他好文 时间:
2014-09-14 23:41:28
阅读次数:
262