码迷,mamicode.com
首页 >  
搜索关键字:c. dzy loves sequences    ( 1332个结果
HDU 5269 && BestCoder #44 1002 ZYB loves Xor I (分治)
题目地址:HDU 5269 比赛的时候想到了分治的思路,但是脑残了。,。写麻烦了。。。调了好久也没调出来。。赛后优化了一下。。就过了。。 我的思路是先排序,排序是按照的将每个数字的二进制表示倒过来的字典序从大到小排,比如样例2中的2,6,5,4,0,二进制分别是010,110,101,100,000,排序之后是 101 110 010 100 000 这样的话就把后缀相同的都给放在一...
分类:其他好文   时间:2015-06-13 23:11:38    阅读次数:313
hdu 5269 ZYB loves Xor I(计数
题意:给出n个数,n个数两两异或后的最后一个bit位k,求所有2^k的和。比赛的时候递归写挂了。。。。痛心啊。。。后来看了半天结果把一个数组移到函数体里就1a了(递归的时候覆盖了。。。)T_T。思路是这样的:如果最后一位不相同,那么他们异或结果的最后一位与二者最后一位较低的相同,那么把这些数字按最后...
分类:其他好文   时间:2015-06-13 22:57:28    阅读次数:105
ACM学习历程—HDU5269 ZYB loves Xor I(位运算 && dfs && 排序)(BestCoder Round #44 1002题)
Problem DescriptionMemphis loves xor very musch.Now he gets an array A.The length of A is n.Now he wants to know the sum of all (lowbit(Ai xor Aj) (i,...
分类:编程语言   时间:2015-06-13 22:53:56    阅读次数:226
bestcoders pog love szhIII
pog loves szh III    Accepts: 63    Submissions: 483  Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) 问题描述 pog在与szh玩游戏,首先pog在纸上画了一棵有根树,这里我们定义1...
分类:其他好文   时间:2015-06-13 11:26:44    阅读次数:115
HDU 5265 pog loves szh II (找两数之和)
题意:给一个数字序列,要求再其中找到两个数,其和再模p的结果是最大的,求此和。思路:先将输入的元素模p,排序。结果可能有两种情况:(1)a+b大于p:肯定由两个最大的数之和来产生。(2)a+b小于p:设b为最大且a+b小于p,那么结果在这两个数的位置之间产生。用两个指针找出来,再与(1)中的ans比...
分类:其他好文   时间:2015-06-12 20:57:05    阅读次数:162
hdu1711 Number Sequence
Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] =...
分类:其他好文   时间:2015-06-12 10:05:21    阅读次数:114
[Water]Hdu 5228 ZCC loves straight flush
枚举法:#include #include #include #include #include #include typedef long long ll;using namespace std;const int MAXN=100005;bool has[52];int f(int start)...
分类:其他好文   时间:2015-06-11 21:12:10    阅读次数:157
Little Prince
You know — one loves the sunset, when one is so sad... 你知道的—当一个人情绪低落的时候,他会格外喜欢看日落...... If someone loves a flower, of which just one single blossom gr...
分类:其他好文   时间:2015-06-10 12:15:43    阅读次数:106
hdu 5265 pog loves szh II
题目链接:hdu 5265解题思路:对输入的数取模后进行排序后二分答案即可。没有注意到溢出问题,跪了三发。。。啥都不说了,代码自有分晓(nlogn)pog loves szh IITime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/65...
分类:其他好文   时间:2015-06-10 00:57:29    阅读次数:172
hdu 5265 pog loves szh II
......
分类:其他好文   时间:2015-06-09 23:46:08    阅读次数:192
1332条   上一页 1 ... 94 95 96 97 98 ... 134 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!