描述:注意需要先self.connect(right)再self.connect(left),否则会有case通不过,原因是左边递归执行时依赖与右边的next已经建立,而先执行connect(left)的话右边还没有完成关系的建立。代码: 1 class Solution: 2 # @par...
分类:
其他好文 时间:
2014-08-01 19:15:42
阅读次数:
223
Problem Description:
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
分析:题目要求输出找出所有在字符串数组中的变形词,变形词的意思是指单词由相同的字母构成,只是字母在单词中的顺序...
分类:
其他好文 时间:
2014-08-01 16:09:01
阅读次数:
164
看到这个问题,第一个反应是真变态啊。 然后,直觉是不能用循环就只能用递归了。可递归怎么跳出来却遇到了麻烦, 我连goto语句都考虑了也没弄好。后来想到一个非常NC的方法:查找表。 如果n限定一个比较小的范围直接用查找表好了。 但题目的目的肯定不是这样的.....后来,我转换了一下思路 1+2...+...
分类:
其他好文 时间:
2014-08-01 15:43:01
阅读次数:
265
Collecting Bugs
Time Limit: 10000MS
Memory Limit: 64000K
Total Submissions: 2341
Accepted: 1126
Case Time Limit: 2000MS
Special Judge
Description
Ivan is fon...
分类:
其他好文 时间:
2014-08-01 13:35:51
阅读次数:
199
Climbing StairsYou are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct way...
分类:
其他好文 时间:
2014-08-01 04:37:21
阅读次数:
244
Q. What does XL stand for? XL is short for eXtensible Lattice. It also connotes an extra large version of PostgreSQL, in this case across multiple systems. Q. Is this a “NoSQL” solution? No, Post...
分类:
其他好文 时间:
2014-08-01 00:17:51
阅读次数:
358
最近测试了一下 erlang的坑...
如不出意外....
大家第一眼看到这语法...
心里第一句一定是"我擦.这TM都是啥!!!!!"
没有变量!!!
没有结构体!!!
没有循环!!!
好吧,至少我是这样想的.
找了半天..连个if也不知道怎么写..
这记录一些基本常识..
-module(module_name) %%定义模...
分类:
其他好文 时间:
2014-07-31 23:57:20
阅读次数:
454
本文分析虚函数的小秘密,通过几个case说明为了支持虚函数,应该有什么样的约定,生成什么样的代码。...
分类:
其他好文 时间:
2014-07-31 17:10:36
阅读次数:
166
题目链接:http://poj.org/problem?id=2823
Sliding Window
Time Limit: 12000MS
Memory Limit: 65536K
Total Submissions: 38315
Accepted: 11350
Case Time Limit: 5000MS...
weeknum = weekDay(now)select case weeknum case "1" data="星期天" case "2" data="星期一" case "3" data="星期二" case "4" data="星期三" case "5" data="星期四" cas...
分类:
其他好文 时间:
2014-07-31 12:48:16
阅读次数:
206