转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4279
HDU集训队选拔赛地点:3教3楼机房,时间:5月10日(周六)12:00开始,请相互转告,谢谢~
百度之星编程大赛——您报名了吗?
...
分类:
其他好文 时间:
2014-05-12 15:05:02
阅读次数:
316
原文:[转载]js
isArray小结在日常开发中,我们经常需要判断某个对象是否是数组类型的,在js中检测对象类型的常见的方法有几种:
1、typeof操作符。对于Function、String、Number、Undefined这几种类型的对象来说,不会有什么问题,但是针对Array的对象就没什么用...
分类:
Web程序 时间:
2014-05-12 07:42:50
阅读次数:
468
HDU 1394 Minimum Inversion Number (数据结构-线段树)
题目大意:
求逆序数。也就是给你一个序列,每次求逆序数,然再把第一个数放到这个序列的末尾,构成新的序列。问你这n个序列的最小的逆序数。
解题思路:
1、对于每个序列,其原来的逆序数记为 pre , 如果当前把该序列 第一个数 a[0] 移动到尾部,那么新序列的逆序数为 pre-a[i]+(n-a[i]-1)
因为序列中比a[i]大的数有 n-a[i]-1 个,比a[i]小的有 a[i]个。
因此只需求出...
分类:
其他好文 时间:
2014-05-12 07:07:01
阅读次数:
301
Given a linked list, reverse the nodes of a
linked listkat a time and return its modified list.If the number of nodes is not
a multiple ofkthen left-o...
分类:
其他好文 时间:
2014-05-11 18:15:52
阅读次数:
300
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Single Number II
Total Accepted: 14224 Total
Submissions: 43648
Given an array of integers, every element appears three ti...
分类:
其他好文 时间:
2014-05-11 03:54:46
阅读次数:
317
题目
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,...
分类:
其他好文 时间:
2014-05-11 03:25:24
阅读次数:
298
题意:在一组数组中除一个元素外其它元素都出现两次,找出这个元素
思路:位运算。异或。因为异或操作可以交换元素的顺序,所以元素异或的顺序没影响,
最后出现再次的元素都会被异或掉,相当于0和只出现一次的那个元素异或,结果还是那个元素
推广:这个方法也适合于出现其它元素都出现偶数次,而要找的元素出现奇数次的情况
相关题目:Single Number II
class Solution...
分类:
其他好文 时间:
2014-05-11 02:37:42
阅读次数:
397
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Maximum Depth of Binary Tree
Total Accepted: 16605 Total
Submissions: 38287
Given a binary tree, find its maximum depth.
...
分类:
其他好文 时间:
2014-05-11 01:58:31
阅读次数:
441
问题提出:服务器100万人在线,16G内存快被吃光。玩家进程占用内存偏高
解决方法:
第一步:
erlang:system_info(process_count). 查看进程数目是否正常,是否超过了erlang虚拟机的最大进程数。
第二步:
查看节点的内存瓶颈所在地方
> erlang:memory().
[{total,2099813400},
{processes,19...
分类:
其他好文 时间:
2014-05-11 01:44:40
阅读次数:
453
原题链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1424
逐渐找到做这种题的感觉了。 二分法。g[i][j]存储坐标(i, j)的值,s[i][j]存储的值为左上角为起始点(1,1),右下角为(i,
j)的矩形区域内所有值的和,那么...
分类:
其他好文 时间:
2014-05-10 22:55:11
阅读次数:
347