uva 725 Division
Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits
0 through 9 once each, such that the first number divided by the second ...
分类:
其他好文 时间:
2015-01-24 14:32:11
阅读次数:
143
【题目】
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()((...
分类:
其他好文 时间:
2015-01-23 23:03:25
阅读次数:
214
Division
Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0through 9 once each, such that the first number divided by the second is e...
分类:
其他好文 时间:
2015-01-23 18:33:20
阅读次数:
194
题目:
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant s...
分类:
编程语言 时间:
2015-01-19 09:26:40
阅读次数:
232
Hacker rank真的比leetcode 难了不止一个等级。。
这题有点巧妙。。深度搜索每条路径,然后枚举,基本很多人都想的出来,但是关键在于这样肯定超时。巧妙之处在于要给每条路径建立一个线段树来加速查询,每次similar查询复杂度从O(h)变成O(lgh)。。
犯了两个错误
(1)要用long来存储线段树,已经可能的similar pairs。
(2)值减去T可能...
分类:
其他好文 时间:
2015-01-18 07:07:00
阅读次数:
412
lua中基础类 lbaselib.c
这里面定义的基础函数,函数指针数组;
static const luaL_Reg base_funcs[] = {
{"assert", luaB_assert},
{"collectgarbage", luaB_collectgarbage},
{"dofile", luaB_dofile},
{"error", luaB_erro...
分类:
其他好文 时间:
2015-01-15 23:48:07
阅读次数:
385
另类乘法
时间限制:3000 ms | 内存限制:65535 KB
难度:1
描述
Bessie is tired of multiplying pairs of numbers the usual way, so she invented her own style of multiplication. In her style, A*B is equal t...
分类:
其他好文 时间:
2015-01-15 22:07:02
阅读次数:
123
题目:
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(()...
分类:
编程语言 时间:
2015-01-10 16:42:46
阅读次数:
261
题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your al...
分类:
编程语言 时间:
2015-01-10 00:57:36
阅读次数:
327
SquaresA children's board game consists of a square array of dots that contains lines connecting some of the pairs of adjacent dots. One part of the g...
分类:
其他好文 时间:
2015-01-05 23:19:39
阅读次数:
295