- 博客(49)
- 资源 (5)
- 收藏
- 关注
原创 Font Size
题目的来源是微软公司2016年的春季校招笔试。我又被人抱了大腿。(啥?为什么这是第一题?因为我水呀。XD)试题概述Steven loves reading book on his phone. The book he reads now consists of N paragraphs and the i-th paragraph contains ai characters.Steven want
2016-04-06 21:39:18
441
原创 蛇形矩阵
本题的来源是2016年的腾讯春季校招笔试题。我只是被人抱了大腿。(o´・ェ・`o)试题描述蛇形矩阵:作为一种常用的数学数列,是由1开始的自然数依次排列成的N*N的正方形矩阵,数字依次由外向内递增,如下面实例: n = 3的蛇形矩阵 1 2 3 8 9 4 7 6 5n = 6的蛇形矩阵 1 2 3 4 5 6 20 21 22 23 24 7 19 32 33 34 25 8
2016-04-03 20:58:17
696
原创 LeetCode. Container With Most Water
试题概述Given n non-negative integers a1a_1, a2a_2, …, ana_n, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, aia_i) and (i,
2016-04-02 15:49:26
315
原创 LeetCodeOJ.ZigZag Conversion
试题请参见: https://leetcode.com/problems/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 pattern in a fix
2016-03-18 10:54:44
359
原创 POJ2054.Color a Tree
试题请参见: http://poj.org/problem?id=2054 Also available on: http://acm.hdu.edu.cn/showproblem.php?pid=1055题目概述Bob is very interested in the data structure of a tree. A tree is a directed graph in which a
2015-10-14 12:23:14
771
原创 LeetCodeOJ.Longest Palindromic Substring
试题请参见: https://leetcode.com/problems/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, and there exis
2015-10-09 09:42:17
923
原创 LeetCodeOJ.Longest Substring Without Repeating Characters
试题请参见: https://leetcode.com/problems/longest-substring-without-repeating-characters/题目概述Given a string, find the length of the longest substring without repeating characters. For example, the longest s
2015-10-08 14:03:39
673
原创 POJ2677.Tour
试题请参见: http://poj.org/problem?id=2677题目概述John Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a small plane and starts visiting beautiful places. To save money, John must determine the s
2015-10-07 20:50:23
2142
原创 LeetCode.Word Break
试题请参见: https://leetcode.com/problems/word-break/题目概述Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For
2015-10-06 16:26:36
1895
原创 HDOJ1016.Prime Ring Problem
试题请参见: http://acm.hdu.edu.cn/showproblem.php?pid=1016题目概述A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adj
2015-10-05 16:56:31
1657
原创 LeetCodeOJ.Jump Game II
试题请参见: https://leetcode.com/problems/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 max
2015-09-27 19:40:46
2920
原创 HDOJ1015.Safecracker
试题请参见: http://acm.hdu.edu.cn/showproblem.php?pid=1015题目概述=== Op tech briefing, 2002/11/02 06:42 CST === “The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes
2015-09-22 19:44:26
2441
原创 HDOJ1009.FatMouse' Trade
试题请参见: http://acm.hdu.edu.cn/showproblem.php?pid=1009题目概述FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehou
2015-09-19 11:42:23
1675
原创 HDOJ1010.Tempter of the Bone
试题请参见: http://acm.hdu.edu.cn/showproblem.php?pid=1010题目概述The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie c
2015-09-18 19:58:40
1596
原创 HDOJ1004.Let the Balloon Rise
试题请参见: http://acm.hdu.edu.cn/showproblem.php?pid=1004题目概述Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most
2015-09-15 10:22:46
1907
原创 HDOJ1003.Max Sum
试题请参见: http://acm.hdu.edu.cn/showproblem.php?pid=1003题目概述Given a sequence a[1],a[2],a[3]……a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in
2015-09-14 15:17:44
2445
原创 POJ3278.Catch That Cow
试题请参见: http://poj.org/problem?id=3278题目概述Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line a
2015-08-08 16:18:07
1690
原创 LeetCodeOJ.Number of Digit One
试题请参见: https://leetcode.com/problems/number-of-digit-one/题目概述Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n =
2015-08-07 11:22:07
1854
原创 POJ1562.Oil Deposits
试题请参见: http://poj.org/problem?id=1562题目概述The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a
2015-08-06 17:42:47
2362
原创 POJ2531.Network Saboteur
试题请参见: http://poj.org/problem?id=2531题目概述A university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network int
2015-08-06 16:31:32
1754
原创 Vijos1016.北京2008的挂钟
试题请参见: https://vijos.org/p/1016题目概述在2008北京奥运会雄伟的主会场的墙上, 挂着如上图所示的3*3的九个挂钟(一开始指针即时针指向的位置请根据输入数据调整). 然而此次奥运会给与了大家一个机会, 去用最少的移动操作改变上面的挂钟的时间全部为12点正(我们只考虑时针). 然而每一次操作并不是任意的, 我们必须按照下面给出的列表对于挂钟进行改变. 每一次操作我们给而
2015-08-04 17:37:40
2540
原创 POJ1664.放苹果
试题请参见: http://poj.org/problem?id=1664题目概述把M个同样的苹果放在N个同样的盘子里, 允许有的盘子空着不放, 问共有多少种不同的分法?(用K表示)5, 1, 1和1, 5, 1 是同一种分法.解题思路首先讨论N, 若N > M, 一定有空盘子, 所以F(M, N) = F(M, M). 否则, 分为两种情况:将M个苹果放入N - 1个盘子中, 即F(M, N
2015-08-02 20:27:50
2808
原创 POJ1579.Function Run Fun
试题请参见: http://poj.org/problem?id=1579题目概述We all love recursion! Don’t we? Consider a three-parameter recursive function w(a, b, c): if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) returns: 1 if a > 2
2015-08-02 19:46:38
1811
原创 Vijos1128.选数
试题请参见: https://vijos.org/p/1128题目概述已知 n 个整数 x1,x2,…,xn, 以及一个整数 k(k<n). 从 n 个整数中任选 k 个整数相加, 可分别得到一系列的和. 例如当 n=4, k=3, 4 个整数分别为 3, 7, 12, 19 时, 可得全部的组合与它们的和为:3+7+12=22 3+7+19=29 7+12+19=38 3+12+19=34
2015-08-01 15:06:56
4499
原创 LeetCodeOJ. Linked List Cycle
试题请参见: https://oj.leetcode.com/problems/linked-list-cycle/题目概述Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?解题思路数据结构典型例题: 使用快慢指针. 快指针遍历
2015-02-21 12:26:46
2189
原创 LeetCodeOJ. Excel Sheet Column Title
试题请参见: https://oj.leetcode.com/problems/excel-sheet-column-title/题目概述Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C...26
2015-02-21 12:09:41
2327
原创 LeetCodeOJ. Valid Parentheses
试题请参见: https://oj.leetcode.com/problems/valid-parentheses/题目概述Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must clo
2015-02-20 15:03:50
2780
原创 LeetCodeOJ. Longest Common Prefix
试题请参见: https://oj.leetcode.com/problems/longest-common-prefix/题目概述
2014-11-05 13:37:52
2055
原创 LeetCodeOJ. Valid Palindrome
试题请参见: https://oj.leetcode.com/problems/valid-palindrome/题目概述Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A
2014-11-03 10:35:39
2016
原创 LeetCodeOJ. Palindrome Number
试题请参见: https://oj.leetcode.com/problems/palindrome-number/题目概述
2014-10-31 09:59:50
2164
原创 LeetCodeOJ. Symmetric Tree
试题请参见: https://oj.leetcode.com/problems/symmetric-tree/题目概述
2014-10-29 13:40:17
1809
原创 LeetCodeOJ. Count and Say
试题请参见: https://oj.leetcode.com/problems/string-to-integer-atoi/
2014-10-24 15:14:25
1629
原创 LeetCodeOJ. String to Integer (atoi)
试题请参见: https://oj.leetcode.com/problems/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,
2014-10-23 19:32:57
1839
原创 LeetCodeOJ. Maximum Depth of Binary Tree
试题请参见: https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/
2014-10-23 17:19:01
1819
原创 LeetCodeOJ. Single Number
试题请参见: https://oj.leetcode.com/problems/single-number/
2014-10-23 16:52:24
1832
原创 Vijos.1096 津津的储蓄计划
试题请参见: https://vijos.org/p/1096题目概述津津的零花钱一直都是自己管理。每个月的月初妈妈给津津300元钱,津津会预算这个月的花销,并且总能做到实际花销和预算的相同。 为了让津津学习如何储蓄,妈妈提出,津津可以随时把整百的钱存在她那里,到了年末她会加上20%还给津津。因此津津制定了一个储蓄计划:每个月的月初,在得到妈妈给的零花钱后,如果她预计到这个月的月末手中
2014-10-12 08:13:30
2405
原创 Vijos1093. 文科生的悲哀
试题请参见: https://vijos.org/p/1093题目概述在这一学期一共有n次文科考试,考试科目有4种,分别为政治、历史、地理和综合。每次考哪一科是不定的,因此在考试前Matrix67不知道应该去复习哪一科的功课。他希望能预测出下一次可能考的科目。于是,他收集到了以往的文科考试的资料。从以往的考试中,他发现了这样几个规律:1.如果这次考的是政治,那么下一次一定会考历史;2.如果这次考的是综合,那么下一次一定会考地理;3.如果这次考的是历史,那么下一次要么考政治,要么考地理;4.如果这
2014-10-11 08:36:31
2989
原创 Vijos1090. 连续数之和
试题请参见: https://vijos.org/p/1090题目概述有n个正整数排成一行。你的目的是要从中取出一个或连续的若干个数,使它们的和能够被k整除。例如,有6个正整数,它们依次为1、2、6、3、7、4。若k=3,则你可以取出1、2、6,或者2、6、3、7,也可以仅仅取出一个6或者3使你所取的数之和能被3整除。当然,满足要求的取法不止以上这4种。事实上,一共有7种取法满
2014-10-10 09:12:53
2537
原创 Vijos1066. 弱弱的战壕
试题请参见: https://vijos.org/p/1066题目概述输入输出解题思路遇到的问题源代码#include
2014-10-07 10:15:33
2355
原创 Vijos1060. 盒子
试题请参见: https://vijos.org/p/1060题目概述输入输出解题思路Reference: http://chengchen2008.blog.163.com/blog/static/2834647520097207256587/深度优先搜索① 两个二维布尔数组: 用于存储地图和遍历记录② 寻找每个坐标③ 对于每个坐标,判
2014-10-04 10:38:36
2358
Ubiquitous Computing
2015-09-17
优盘内容拷贝(含源代码)
2014-10-07
软件基础知识问答系统
2012-01-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人