Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 8501Accepted Submissi...
分类:
其他好文 时间:
2014-08-28 14:46:39
阅读次数:
215
16.Setting which of the following initialization parameters enables Automatic Memory Management?
A. MEMORYJARGET
B. MEMORY_MAX_TARGET
C. SGATARGET
D. PGA AGGREGATE TARGET
Answer: A
【解析】
...
分类:
其他好文 时间:
2014-08-28 00:57:28
阅读次数:
244
题意:
给出一排敌军的血量,每次攻击都能将范围内的敌军血量变为原来血量的算术平方根(下取整),并询问范围内敌军的血量和。
分析:
显然的线段树,但是似乎不太好设计lazy标记啊,我们想一想算术平方根,sqrt(1)=1,且64位整数范围内最多6次就变到1了,那么只要区间内的数都为1,我就不用更新这个区间了,所以每次更新都更新到叶子结点,维护区间和就行了。数据里没有0,不过X>Y这种trick有意思吗?...
分类:
其他好文 时间:
2014-08-27 20:36:58
阅读次数:
266
Recently, I study the package net/url of Golang.I was puzzled about the escape and unescape of url string.then I find a clear and accurate answer at:h...
分类:
其他好文 时间:
2014-08-24 23:48:33
阅读次数:
289
暴力+构造
If r?-?l?≤?4 we can all subsets of size not greater than k.
Else, if k?=?1, obviously that answer is l. If k?=?2,
answer is 1, because xor of numbers 2x and 2x?+?1 equls 1.
If k?≥...
分类:
其他好文 时间:
2014-08-24 11:40:22
阅读次数:
233
poj 2002 Squares
给出n个点,问能组成多少个正方形?
题解:
先把每个点hash
然后枚举两点(即枚举正方形的一条边),然后通过三角形全等,可以推出正方形的另外两点,在hash表里查找这两点看是存在,存在则 Cnt +1。
最后 answer = Cnt/4 //因为同一正方形都统计了4次。
#include
#include
#in...
分类:
其他好文 时间:
2014-08-22 13:03:48
阅读次数:
229
From now on, I'm gonna say yes--yes to love, yes to adventure, yes to life, whatever it maybe, the answer's going to be yes从今天起,我要积极接受一切,接受爱,迎接挑战,拥抱生活...
分类:
其他好文 时间:
2014-08-22 09:15:45
阅读次数:
241
这个十分有趣的题目出自知乎http://www.zhihu.com/question/24905007/answer/29414497 ,排名第一的知友的答案用python简洁的给出了代码和答案,枉费我用C++ 鼓捣了半天。。。 不过也不能算是白做,还是有颇多收获的。 先准确描述一下这个问题解决思路...
分类:
移动开发 时间:
2014-08-21 18:57:44
阅读次数:
262
直接暴力更新,复杂度10NlogN#include #include #include #include #include #include #include #include #include #include #include #include #include #include #includ...
分类:
其他好文 时间:
2014-08-21 14:46:24
阅读次数:
179
1> 编写strcpy函数,已知函数原型char*strcpy(char* strDest,char* strSrc)
ANSWER:
Chat* strcpy(char* strDest,char* strSrc)
{
If(strSrc==NULL) return NULL;
Char*ch1=strSrc,*ch2=strDest;
While(*ch1!=’\0’)
...
分类:
编程语言 时间:
2014-08-20 14:13:42
阅读次数:
250