【题目】原文:1.3 Design an algorithm and write code
to remove the duplicate characters in a string without using any additional
buffer. NOTE: One or two add...
分类:
其他好文 时间:
2014-06-02 21:32:04
阅读次数:
284
BFS+状态压缩,做了很多状态压缩了。今晚把八数码问题给搞定了。 1 #include 2
#include 3 #include 4 #include 5 using namespace std; 6 7 typedef struct node_st
{ 8 int x, y, ...
分类:
其他好文 时间:
2014-06-02 17:14:38
阅读次数:
232
Finding NemoTime Limit: 2000MSMemory Limit:
30000KTotal Submissions: 7376Accepted: 1717DescriptionNemo is a naughty boy. One
day he went into the deep...
分类:
其他好文 时间:
2014-06-01 12:23:25
阅读次数:
200
题目链接:http://poj.org/problem?id=3252题意:给出一个二进制区间,求出0的个数不小于1的个数这样的二进制个数解法:数位DP,定义状态dp[len][num_zero][num_one],num_zero
定义为写0的个数。 1 #include 2 #include 3...
分类:
其他好文 时间:
2014-06-01 12:06:33
阅读次数:
191
【题目】
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/ gr eat
/ \ / g r e at
/ ...
分类:
其他好文 时间:
2014-06-01 09:41:05
阅读次数:
196
【题目】
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are...
分类:
其他好文 时间:
2014-06-01 09:21:16
阅读次数:
292
title:
A Pythagorean triplet is a set of three natural numbers, a
b
c, for which,
a2 + b2 =
c2
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for wh...
分类:
其他好文 时间:
2014-06-01 09:17:53
阅读次数:
251
【题目】
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 gray code. A gray code sequence must begin with 0.
...
分类:
其他好文 时间:
2014-06-01 09:16:29
阅读次数:
242
title:
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
37107287533902102798797998220837590246510135740250
4637693767749000971264812489697007805041701826053...
分类:
其他好文 时间:
2014-06-01 08:53:33
阅读次数:
276
最近学习了ELF格式文件,在学习过程中产生过很多疑惑,也翻找了不少网上资源。期间经常会惊讶于设计者的思路。预计整个工程分成三个部分,这里是第一个部分,介绍了一些前期遇到的问题。因为这是这个月的最后一天,且特别想去赶5:50的“X战警-逆转未来”,所以就将未完品发了出来。...
分类:
其他好文 时间:
2014-06-01 07:11:30
阅读次数:
360