欢迎来到PJCK的博客

上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge. If the town judge exists, th 阅读全文
posted @ 2019-05-17 19:19 PJCK 阅读(100) 评论(0) 推荐(0) 编辑
摘要: There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct 阅读全文
posted @ 2019-05-17 16:27 PJCK 阅读(234) 评论(0) 推荐(0) 编辑
摘要: There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access the next r 阅读全文
posted @ 2019-05-17 09:56 PJCK 阅读(131) 评论(0) 推荐(0) 编辑
摘要: An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr, 阅读全文
posted @ 2019-05-16 20:58 PJCK 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land) A move consists of walking from one land square 4-directionally to anot 阅读全文
posted @ 2019-05-15 21:19 PJCK 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 迷宫问题 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 41913 Accepted: 23240 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 阅读全文
posted @ 2019-05-15 13:08 PJCK 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
posted @ 2019-05-15 08:59 PJCK 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文
posted @ 2019-05-14 22:33 PJCK 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2019-05-14 21:51 PJCK 阅读(83) 评论(0) 推荐(0) 编辑
摘要: You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can follow an 阅读全文
posted @ 2019-05-10 21:15 PJCK 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, it 阅读全文
posted @ 2019-05-10 21:01 PJCK 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 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 fo 阅读全文
posted @ 2019-05-10 19:19 PJCK 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: E 阅读全文
posted @ 2019-05-10 19:03 PJCK 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: 这是一个DP题,好像是线性DP吧。 官方题解有DP的 阅读全文
posted @ 2019-05-10 12:30 PJCK 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2019-05-10 09:39 PJCK 阅读(111) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页