题意:
     给你ABCD四个集合,集合中数的个数都为N(N
     当然你可以尝试枚举所有的组合,绝对可以计算出结果,大概有N^4种吧,如果你有足够的时间还是可以算出来的,哈哈。
      当然我不是用上面一种方法计算的,那样算肯定超时。 我的做法是求出所有a+b 到ab数组中, 和所有 c+d到cd数组中,然后排序,枚举每个ab,用二分在cd中查找有没有可能组成0。  有个问题就...
                            
                            
                                分类:
其他好文   时间:
2014-05-10 08:40:14   
                                阅读次数:
278
                             
                    
                        
                            
                            
                                今天又个兄弟求助,数据库里一个表有数据如下:
no  name
1    a
2    b
3    c
4    d
如何用一个sql显示如下结果:
ab
ac
ad
bc
bd
cd
对于这种构造数据,是分析函数的强项,下面来做个试验:
create table t (no number,name varchar(2));
insert into t va...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 08:03:17   
                                阅读次数:
447
                             
                    
                        
                            
                            
                                题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1836
Number Puzzle
Time Limit: 2 Seconds      Memory Limit: 65536 KB
Given a list of integers (A1, A2, ..., An), and a posi...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 07:42:49   
                                阅读次数:
332
                             
                    
                        
                            
                            
                                The Little Elephant likes permutations. This time he has a permutation A[1], A[2], ..., A[N] of numbers 1, 2, ...,N.
He calls a permutation A good, if the number of its inversions is equal to the n...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 07:20:50   
                                阅读次数:
356
                             
                    
                        
                            
                            
                                大意:每个测试用例是一个数组。找出xi和xj,(xi>xj),做运算令xi=xi-xj。可以做若干组这样的运算,使得最后的数组和最小。输出此和。
分析:用优先队列,每次找出最大的和次大的,处理后再加入此队列。注意多个相同的xi这种情况!...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 07:19:27   
                                阅读次数:
301
                             
                    
                        
                            
                            
                                The number of steps
Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^
题目描述
 
   Mary stands in a strange maze, the maze looks like a triangle(the first layer have one room,the seco...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 06:15:59   
                                阅读次数:
427
                             
                    
                        
                            
                            
                                The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gr...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 06:10:17   
                                阅读次数:
370
                             
                    
                        
                            
                            
                                转载请注明 本文出自:http://blog.csdn.net/nancle
首先说==和===
首先说明一个很特殊的值NaN, typeof(Nav)得到'number',但是NaN不等于任何一个值(包括它本身),判断一个值是不是NaN只能使用isNaNNaN == NaN //得到 false
NaN === NaN //得到false
isNaN(NaN) //得到true
然...
                            
                            
                                分类:
编程语言   时间:
2014-05-07 03:58:30   
                                阅读次数:
363
                             
                    
                        
                            
                            
                                #! /usr/bin/env racket
#lang racket
#|
  NAME:
     getModelNumber.rkt
     This program is used to get model number based on the
     input model file name.
  USAGE:
     ./getModelNumber.rkt modelfi...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 03:17:09   
                                阅读次数:
323
                             
                    
                        
                            
                            
                                五一中间断了几天,开始继续。。。
1、
??
Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 18:54:59   
                                阅读次数:
386