找规律
Number Sequence
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 303 Accepted Submission(s): 149
Special Judge
Problem D...
分类:
其他好文 时间:
2014-09-15 01:09:18
阅读次数:
147
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
HDU 5014 Number Sequence,二进制异或处理。...
分类:
其他好文 时间:
2014-09-14 23:46:17
阅读次数:
479
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
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5014解题报告:西安网赛的题,当时想到一半,只想到从大的开始匹配,做异或运算得到对应的b[i],但是少了一个操作,ans[i] = temp,却没有想到ans[temp] = i;所以就一直卡在这里了,因...
分类:
其他好文 时间:
2014-09-14 23:28:07
阅读次数:
219
HDU 5014 Number Sequence
题目链接
思路:对于0-n,尽量不让二进制中的1互相消掉就是最优的,那么只要两个数只要互补就可以了,这样每次从最大的数字,可以找到和他互补的数字,然后这个区间就能确定了,然后剩下的递归下去为一个子问题去解决
代码:
#include
#include
const int N = 100005;
int n, a[N]...
分类:
其他好文 时间:
2014-09-14 22:12:27
阅读次数:
220
HDU 5014 Number Sequence(异或 进制问题)...
分类:
其他好文 时间:
2014-09-14 22:10:27
阅读次数:
387
尽可能凑2^x-1
#include
#include
const int N = 100005;
int a[N], p[N];
int init(int x) {
int cnt = 0;
while(x > 1) {
x /= 2;
cnt ++;
}
return cnt + 1;
}
int main() {
int n;
while(~scanf("%d", ...
分类:
其他好文 时间:
2014-09-14 20:49:07
阅读次数:
165
hdu 2817 A sequence of numbers...
分类:
其他好文 时间:
2014-09-14 09:00:06
阅读次数:
188
DNA Sorting
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 83069
Accepted: 33428
Description
One measure of ``unsortedness'' in a sequence is the number o...
分类:
其他好文 时间:
2014-09-14 00:12:10
阅读次数:
387