09 2017 档案
leetcode 507. Perfect Number
摘要:We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write 阅读全文
posted @ 2017-09-25 11:36 Beserious 阅读(120) 评论(0) 推荐(0) 编辑
leetcode 681. Next Closest Time
摘要:Given a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit 阅读全文
posted @ 2017-09-24 23:46 Beserious 阅读(1177) 评论(0) 推荐(0) 编辑
leetcode 682. Baseball Game
摘要:You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Integer (one round's score): Dire 阅读全文
posted @ 2017-09-24 23:44 Beserious 阅读(213) 评论(0) 推荐(0) 编辑
leetcode 684. Redundant Connection
摘要:We are given a "tree" in the form of a 2D array, with distinct values for each node. In the given 2D array, each element pair [u, v] represents that v 阅读全文
posted @ 2017-09-24 23:43 Beserious 阅读(399) 评论(0) 推荐(0) 编辑
leetcode 677. Map Sum Pairs
摘要:Implement a MapSum class with insert, and sum methods. For the method insert, you'll be given a pair of (string, integer). The string represents the k 阅读全文
posted @ 2017-09-24 00:31 Beserious 阅读(222) 评论(0) 推荐(0) 编辑
leetcode 402. Remove K Digits
摘要:Given a non negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l 阅读全文
posted @ 2017-09-24 00:13 Beserious 阅读(92) 评论(0) 推荐(0) 编辑
python numpy
摘要:python keepdims = True和 keepdims = False的区别,设置为True就是保持原来的列矩阵,否则就变成一位数组 切片和np.arange()的区别 阅读全文
posted @ 2017-09-19 20:05 Beserious 阅读(127) 评论(0) 推荐(0) 编辑
leetcode 409. Longest Palindrome
摘要:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This 阅读全文
posted @ 2017-09-14 12:29 Beserious 阅读(107) 评论(0) 推荐(0) 编辑
leetcode 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" Output: "b 阅读全文
posted @ 2017-09-10 00:42 Beserious 阅读(110) 评论(0) 推荐(0) 编辑
leetcode 2. Add Two Numbers
摘要:You are given two non empty linked lists representing two non negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文
posted @ 2017-09-06 23:12 Beserious 阅读(129) 评论(0) 推荐(0) 编辑
leetcode 11. Container With Most Water
摘要:Given n non negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2017-09-05 12:49 Beserious 阅读(128) 评论(0) 推荐(0) 编辑
leetcode 208. Implement Trie (Prefix Tree)
摘要:Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist of lowercase letters a z. 字典树 阅读全文
posted @ 2017-09-04 20:32 Beserious 阅读(120) 评论(0) 推荐(0) 编辑
leetcode 15. 3Sum
摘要:每日一道题目,预防思维僵化 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which giv 阅读全文
posted @ 2017-09-04 15:04 Beserious 阅读(159) 评论(0) 推荐(0) 编辑
链家2018链习生招聘 编程题三
摘要:小明有n(1 using namespace std; int dp[2010][2010]; int main() { int n; while (cin n) { vector v(n); memset(dp, 0, sizeof dp); for (int i = 0; i v[i]; // 阅读全文
posted @ 2017-09-03 17:07 Beserious 阅读(1230) 评论(7) 推荐(0) 编辑
leetcode 669. Trim a Binary Search Tree
摘要:Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R = L). You might 阅读全文
posted @ 2017-09-03 12:28 Beserious 阅读(263) 评论(0) 推荐(0) 编辑
leetcode 671. Second Minimum Node In a Binary Tree
摘要:Given a non empty special binary tree consisting of nodes with the non negative value, where each node in this tree has exactly two or zero sub node. 阅读全文
posted @ 2017-09-03 11:13 Beserious 阅读(181) 评论(0) 推荐(0) 编辑
leetcode 670. Maximum Swap
摘要:Given a non negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
posted @ 2017-09-03 11:11 Beserious 阅读(408) 评论(0) 推荐(0) 编辑
leetcode 290. Word Pattern
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2017-09-02 20:20 Beserious 阅读(105) 评论(0) 推荐(0) 编辑
python脚本
摘要:无意间发现这个http://codevs.cn/ 这个网站的注册和登录犹如大学教务管理系统,post的数据都是明文的。我就呵呵呵了 那么,我们就写个自动注册脚本。批量注册。 coding=utf 8 import requests, random def go(n, p): header = { ' 阅读全文
posted @ 2017-09-02 13:59 Beserious 阅读(189) 评论(0) 推荐(0) 编辑
leetcode 664. Strange Printer
摘要:There is a strange printer with the following two special requirements: Given a string consists of lower English letters only, your job is to count th 阅读全文
posted @ 2017-09-02 13:44 Beserious 阅读(1197) 评论(0) 推荐(0) 编辑