02 2019 档案
发表于 2019-02-28 21:10阅读:1030评论:0推荐:0
摘要:编程题#1:输出200 来源: 北京大学在线程序评测系统POJ (Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩。) 总时间限制: 1000ms 内存限制: 1024kB 描述使以下代码输出结果为200. 输入不需要输入。 输出输出结果为200。 Code: 编程题#
阅读全文 »
发表于 2019-02-28 09:55阅读:331评论:0推荐:0
摘要:In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach o
阅读全文 »
发表于 2019-02-28 08:59阅读:283评论:0推荐:0
摘要:A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the
阅读全文 »
发表于 2019-02-27 12:18阅读:519评论:0推荐:0
摘要:1091 N-自守数 (15 分) 如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3,而 2 的末尾两位正好是 9,所以 9 是一个 3-自守数。 本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。 输入格式: 输入在第一行
阅读全文 »
发表于 2019-02-26 18:33阅读:1043评论:0推荐:0
摘要:距离上次我一个人参加PAT考试已经过去快一个学期了,想想上次自己也是搞笑,自己一个人被这个书包就去了ZZ,人生地不熟的,乘坐公交车还坐反了。考完试因为不知道要等到考试结束就可以领取成绩证书,自己连那张不及格的证书都没有领,就急着赶火车回到了学校。因为这个周末就参加考试了,所以考试前做几道题熟悉一下试
阅读全文 »
发表于 2019-02-25 21:55阅读:3883评论:0推荐:0
摘要:记得之前电脑上的那个Ubuntu是去年寒假的时候安装的,算下来自己用Linux也快一年了。虽然在去年暑假的时候我也曾经想过要把Ubuntu升级到18.04可是当时安装了几次都没有成功,自己也就放弃了。于是就用Ubuntu17.10用了将近一年,从刚开始的的小白对linux一窍不通,到现在的大白。在使
阅读全文 »
发表于 2019-02-19 23:22阅读:248评论:0推荐:0
摘要:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both
阅读全文 »
发表于 2019-02-19 22:56阅读:193评论:0推荐:0
摘要:A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the
阅读全文 »
发表于 2019-02-19 22:10阅读:187评论:0推荐:0
摘要:A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but i
阅读全文 »
发表于 2019-02-18 00:21阅读:197评论:0推荐:0
摘要:Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.
阅读全文 »
发表于 2019-02-17 23:25阅读:175评论:0推荐:0
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron
阅读全文 »
发表于 2019-02-16 22:59阅读:181评论:0推荐:0
摘要:Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or
阅读全文 »
发表于 2019-02-16 22:24阅读:184评论: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
阅读全文 »
发表于 2019-02-16 21:47阅读:178评论: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
阅读全文 »
发表于 2019-02-16 20:51阅读:295评论:0推荐:0
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee
阅读全文 »
发表于 2019-02-15 22:32阅读:168评论:0推荐:0
摘要: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
阅读全文 »
发表于 2019-02-15 21:59阅读:249评论:0推荐:0
摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: Approach #1: My code. [C++] Appro
阅读全文 »
发表于 2019-02-15 21:49阅读:214评论: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: Approach #1: DP. [C++] Ana
阅读全文 »
发表于 2019-02-15 20:23阅读:225评论:0推荐:0
摘要:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are ar
阅读全文 »
发表于 2019-02-15 20:05阅读:206评论:0推荐:0
摘要:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo
阅读全文 »
发表于 2019-02-14 23:34阅读:187评论: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
阅读全文 »
发表于 2019-02-12 23:31阅读:237评论:0推荐:0
摘要:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ
阅读全文 »
发表于 2019-02-12 22:48阅读:252评论:0推荐:0
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning
阅读全文 »
发表于 2019-02-12 22:16阅读:201评论: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
阅读全文 »
发表于 2019-02-11 22:40阅读:166评论:0推荐:0
摘要:Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence of a string is a new string which is for
阅读全文 »
发表于 2019-02-11 22:13阅读:227评论:0推荐:0
摘要:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1: Example 2: Approach #1: DP. [C++] Analysis: status: match[s1L
阅读全文 »
发表于 2019-02-11 21:26阅读:213评论:0推荐:0
摘要:Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: Approach #1: DP. [C++] Analysis: status: nums[n]
阅读全文 »
发表于 2019-02-09 00:29阅读:194评论:0推荐:0
摘要:Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the f
阅读全文 »
发表于 2019-02-08 23:23阅读:353评论:0推荐:0
摘要:On a 2-dimensional grid, there are 4 types of squares: 1 represents the starting square. There is exactly one starting square. 2 represents the ending
阅读全文 »
发表于 2019-02-08 21:43阅读:231评论:0推荐:0
摘要:Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible stri
阅读全文 »
发表于 2019-02-06 23:49阅读:384评论:0推荐:0
摘要:We are given N different types of stickers. Each sticker has a lowercase English word on it. You would like to spell out the given target string by cu
阅读全文 »
发表于 2019-02-06 23:04阅读:235评论:0推荐:0
摘要:Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of t
阅读全文 »
发表于 2019-02-06 00:38阅读:198评论:0推荐:0
摘要:A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents
阅读全文 »
发表于 2019-02-05 23:32阅读:250评论:0推荐:0
摘要:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example: Input: 2 Output: 91 Explanation: The answer shoul
阅读全文 »
发表于 2019-02-05 23:02阅读:179评论:0推荐:0
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example: I
阅读全文 »
发表于 2019-02-05 00:31阅读:215评论:0推荐:0
摘要:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is
阅读全文 »
发表于 2019-02-04 23:58阅读:256评论:0推荐:0
摘要:Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such th
阅读全文 »
发表于 2019-02-03 00:08阅读:344评论:0推荐:0
摘要:Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adja
阅读全文 »
发表于 2019-02-02 22:37阅读:278评论:0推荐:0
摘要:Bholu the Pandit on this New Year wanted to divide his Cuboidal Packaging block into cubes. But he loves uniformity so he asks you to divide it such a
阅读全文 »
发表于 2019-02-01 22:50阅读:145评论:0推荐:0
摘要:Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be
阅读全文 »
发表于 2019-02-01 00:06阅读:237评论:0推荐:0
摘要:Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a r
阅读全文 »