李景旺的博客

www.jingwangl.com

10. Regular Expression Matching

Implement regular expression matching with support for '.' and '*'.'.' Matches any single character. '*' Matches zero or more of the preceding elemen...

2018-03-30 21:56:59

阅读数:21

评论数:0

9. Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (...

2018-03-29 23:02:43

阅读数:18

评论数:0

7. Reverse Integer

Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123 Output: 321 Example 2:Input: -123 Output: -321 Example 3:Input: 120...

2018-03-28 18:05:49

阅读数:23

评论数:0

6. ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this patte...

2018-03-28 16:53:11

阅读数:11

评论数:0

1742:Coins

CoinsTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 40853 Accepted: 13835DescriptionPeople in Silverland use coins.They have coins of valu...

2018-03-25 23:49:56

阅读数:43

评论数:0

5. Longest Palindromic Substring

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad&...

2018-03-25 12:36:18

阅读数:27

评论数:0

4. Median of Two Sorted Arrays

There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity sh...

2018-03-24 18:13:02

阅读数:16

评论数:0

2229:Sumsets

SumsetsTime Limit: 2000MS Memory Limit: 200000KTotal Submissions: 21492 Accepted: 8355DescriptionFarmer John commanded his cows to search for differe...

2018-03-22 23:32:11

阅读数:23

评论数:0

3616:Milking Time

Milking TimeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12004 Accepted: 5067DescriptionBessie is such a hard-working cow. In fact, she ...

2018-03-21 23:54:26

阅读数:22

评论数:0

2385:Apple Catching

Apple CatchingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14130 Accepted: 6905DescriptionIt is a little known fact that cows love apple...

2018-03-21 12:22:32

阅读数:27

评论数:0

3176:Cow Bowling

Cow BowlingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21242 Accepted: 14046DescriptionThe cows don't use actual bowling balls when the...

2018-03-20 23:17:00

阅读数:28

评论数:0

0-1 背包问题

0-1 背包问题:给定 n 种物品和一个容量为 C 的背包,物品 i 的重量是 wi,其价值为 vi 。问:应该如何选择装入背包的物品,使得装入背包中的物品的总价值最大?递归解法,对每个物品是否装入背包进行搜索:int n,w; int w[maxn],v[maxn]; int rec(int i...

2018-03-18 00:08:22

阅读数:28

评论数:0

3253:Fence Repair

Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 56309 Accepted: 18537DescriptionFarmer John wants to repair a small length of t...

2018-03-17 23:27:09

阅读数:23

评论数:0

3069:Saruman's Army

Saruman's ArmyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12700 Accepted: 6390DescriptionSaruman the White must lead his army along a s...

2018-03-17 11:40:51

阅读数:46

评论数:0

3617:Best Cow Line

Best Cow LineTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 29339 Accepted: 7861DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows ...

2018-03-17 10:05:02

阅读数:24

评论数:0

区间调度问题

问题主题:区间调度问题问题描述:有n项工作,每项工作分别在si开始,ti结束。对每项工作,你都可以选择参加或不参加,但选择了参加某项工作就必须至始至终参加全程参与,即参与工作的时间段不能有重叠(即使开始的时间和结束的时间重叠都不行)。限制条件:1<=n<...

2018-03-16 23:57:45

阅读数:50

评论数:1

迷宫的最短路径

给定一个大小为N*M的迷宫,由通道('.')和墙壁('#')组成,其中通道S表示起点,通道G表示终点,每一步移动可以达到上下左右中不是墙壁的位置。试求出起点到终点的最小步数。(本题假定迷宫是有解的)(N,M<=100)样例输入:10 10样例输出:22#include&...

2018-03-16 17:46:21

阅读数:51

评论数:0

2386:Lake Counting

总时间限制: 1000ms内存限制: 65536kB描述Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N ...

2018-03-15 00:46:15

阅读数:31

评论数:0

部分和问题

部分和问题时间限制:1000 ms  |  内存限制:65535 KB难度:2描述给定整数a1、a2、.......an,判断是否可以从中选出若干数,使它们的和恰好为K。输入首先,n和k,n表示数的个数,k表示数的和。接着一行n个数。(1<=n<=20,...

2018-03-14 23:17:30

阅读数:37

评论数:0

抽签问题

试题描述你的朋友提议玩一个游戏:将写有数字的n 个纸片放入口袋中,你可以从口袋中抽取4 次纸片,每次记下纸片上的数字后都将其放回口袋中。如果这4 个数字的和是m,就是你赢,否则就是你的朋友赢。你挑战了好几回,结果一次也没赢过,于是怒而撕破口袋,取出所有纸片,检查自己是否真的有赢的可能性。请你编写一...

2018-03-14 22:35:24

阅读数:60

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭