- 博客(20)
- 收藏
- 关注
原创 1312 : 搜索三·启发式搜索
时间限制:10000ms单点时限:1000ms内存限制:256MB描述在小Ho的手机上有一款叫做八数码的游戏,小Ho在坐车或者等人的时候经常使用这个游戏来打发时间。游戏的棋盘被分割成3x3的区域,上面放着标记有1~8八个数字的方形棋子,剩下一个区域为空。游戏过程中,小Ho只能移动棋子到相邻的空区域上。当小Ho将8个棋子都移动到如下图所示的位置时,
2017-03-31 20:06:32 450
原创 1015 : KMP算法
时间限制:1000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。这一天,他们遇到了一只河蟹,于是河蟹就向小Hi和小Ho提出了那个经典的问题:“小Hi和小Ho,你们能不能够判断一段文字(原串)里面是不是存在那么一些……特殊……的文字(模
2017-03-31 16:39:38 206
原创 1014 : Trie树
时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。这一天,他们遇到了一本词典,于是小Hi就向小Ho提出了那个经典的问题:“小Ho,你能不能对于每一个我给出的字符串,都在这个词典里面找到以这个字符串开头的所有单词呢?
2017-03-31 11:13:50 156
原创 1000 : A + B
时间限制:1000ms单点时限:1000ms内存限制:256MB描述求两个整数A+B的和输入输入包含多组数据。每组数据包含两个整数A(1 ≤ A ≤ 100)和B(1 ≤ B ≤ 100)。输出对于每组数据输出A+B的和。样例输入1 23 4样例输出37感觉每个oj的第一题都是A+B
2017-03-31 10:22:44 298
原创 210. Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as
2017-03-31 09:59:44 242
原创 207. Course Schedule
There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as
2017-03-31 09:48:18 196
原创 115. Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be non
2017-03-30 20:02:12 207
原创 514. Freedom Trail
In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the dial to spell a specific keyword in order to open the door.
2017-03-25 16:04:04 949
原创 leetcode上数据库的题目(1)
175. Combine Two TablesTable: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |
2017-03-24 18:24:40 895
原创 307. Range Sum Query - Mutable
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val) function modifies nums by updating the element at index i to val.Examp
2017-03-20 14:36:50 319
原创 63. Unique Paths II
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the
2017-03-18 10:55:52 217
原创 8. String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca
2017-03-15 11:04:31 269
原创 45. Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal i
2017-03-12 11:19:54 375
原创 304. Range Sum Query 2D - Immutable
Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).The above rectangle (with the red bo
2017-03-11 12:17:08 224
转载 C编译: 使用gdb调试
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明。谢谢! gdb是the GNU Debugger的简称。它是一款UNIX平台的调试器(debugger),可用于为C, C++, Objective-C, Java, Fortran等程序debug。在gdb中,你可以通过设置断点(break poin
2017-03-08 16:48:03 327
原创 192到195题
192. Word FrequencyWrite a bash script to calculate the frequency of each word in a text file words.txt.For simplicity sake, you may assume:words.txt contains only lowercase characters a
2017-03-08 12:18:24 295
原创 297. Serialize and Deserialize Binary Tree
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be
2017-03-04 13:35:42 156
原创 154. Find Minimum in Rotated Sorted Array II & 153. Find Minimum in Rotated Sorted Array
Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Suppose an array sorted in ascending order is rot
2017-03-03 10:02:27 410
原创 472. Concatenated Words
Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words.A concatenated word is defined as a string that is comprised entir
2017-03-03 09:19:06 269
原创 381. Insert Delete GetRandom O(1) - Duplicates allowed
Design a data structure that supports all following operations in averageO(1) time.Note: Duplicate elements are allowed.insert(val): Inserts an item val to the collection.remove(val): Remove
2017-03-01 14:28:16 196
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人