TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given...
分类:
其他好文 时间:
2014-07-22 22:47:52
阅读次数:
230
题目:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the tw....
分类:
编程语言 时间:
2014-07-22 22:47:33
阅读次数:
256
题目链接题意 :给你一个字符串,让你删除或添加某些字母让这个字符串变成回文串,删除或添加某个字母要付出相应的代价,问你变成回文所需要的最小的代价是多少。思路 :DP[i][j]代表的是 i 到 j 这一段位置变成回文所需的最小的代价。 1 //3280 2 #include 3 #include ....
分类:
其他好文 时间:
2014-07-22 22:46:35
阅读次数:
217
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:
其他好文 时间:
2014-07-22 22:40:36
阅读次数:
238
Round Numbers
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 8590
Accepted: 3003
Description
The cows, as you know, have no fingers or thumbs and thus a...
分类:
其他好文 时间:
2014-07-22 14:30:24
阅读次数:
168
Round Numbers:如果n换成二进制后,0的个数大于等于1的个数
求x-y范围内Round Numbers有几个...
分类:
其他好文 时间:
2014-07-21 23:46:54
阅读次数:
196
题目大意:给定一个字符串,求最少插入几个字符让该字符串成为回文串
法一:
dp[i][j]表示使区间[i,j]成为回文串最小插入的字符数,则状态转移方程
1、if s[i]==s[len-1] 则:d[i][j]=d[i+1][j-1]
2、else d[i]=min(dp[i+1][j],dp[i][j-1])
首尾字符不同的时候,有两种决策。
1、将新字符插在首位,那么状态就...
分类:
其他好文 时间:
2014-07-21 23:30:01
阅读次数:
255
#pragma warning(disable:4996)
#include <cstdio>
#include <tchar.h>
#include <Windows.h>
#include <vector>
using namespace std;
/*
submit time : 1
request :
Given a collection of numbers, retu...
分类:
其他好文 时间:
2014-07-21 23:27:50
阅读次数:
368
POJ 1159 Palindrome && HDU 1159 Common Subsequence...
分类:
其他好文 时间:
2014-07-21 23:27:29
阅读次数:
249
Sum of Consecutive Prime Numbers
Description
Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive ...
分类:
其他好文 时间:
2014-07-21 22:18:12
阅读次数:
222