自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(225)
  • 收藏
  • 关注

原创 sql类型学习

字符数据可以包含中英文字、空格、特殊字符(*、&、%等)及不具数值意义的数字(邮政编码及电话号等)。char(n)用来存放“固定长度”的n个字符的非Unicode字符数据。n值介于1~8000。 若输入到各条数据记录的某字段的文本数据具有相同的长度,该字段适合char数据类型。比如:身份证号、电话号、邮编、省名、识别码等。 可以利用n来限制用户能输入到char的字符数。存储的数据比

2019-06-02 16:14:43 344

原创 CDN笔记

CDN是什么Content Distribute Network,直译成内容分发网络CDN是将源站内容分发至最接近用户的节点,使用户可就近取得所需内容,提高用户访问的响应速度和成功率。解决因分布、带宽、服务器性能带来的访问延迟问题,适用于站点加速、点播、直播等场景。也可以说是:尽可能避开互联网上有可能影响数据传输速度和稳定性的瓶颈和环节,使内容传输的更快、更稳定。通过在网络各处放置节点服务器...

2019-06-01 23:36:19 202

原创 DNS笔记

DNS笔记为什么需要DNS用户在上网时,只有一个网站的域名。但是计算机在通信时,需要IP地址才能识别(大多数的网络通讯都是基于TCP/IP的,其又基于IP地址)。DNS可以理解为一位翻译官,将域名翻译成计算机可识别的IP地址。DNS的作用给出一个域名,返回该域名可以访问的IP地址。主机给出域名 -> DNS获得域名 -> 翻译后获得 ip -> 主机获得ip...

2019-05-31 17:23:23 295

原创 流畅的python

3.8.1set两个集合a, b:a & b 交集a | b 合集a - b 差集比直接for循环省时间dictsetdefault更新value且避免重复搜索dict查找key非常快,同时很消耗内存不要对字典同时进行迭代和修改。如果想扫描并修改一个字典,最好:1.迭代,找出需要添加的内容,放入一个新字典2.迭代结束后对原有字典进行更新原因:往dict添加新key...

2019-05-15 15:22:05 1502

原创 日语五十音

背了三四天五十音,记一下网址,感觉边背边写还是完全ojk的发音: https://jp.hjenglish.com/subject/pronounce_write/记忆: https://www.zhihu.com/question/20318161/answer/67015673手写版: ...

2018-05-06 14:45:26 1039

原创 python初学时

python 备忘/ 10 / 3 = 3.3333333// 10 // 3 = 3 ord() ord(‘A’) = 65chr() chr(20013) = ‘中’list mie = [1, 2, 3, 4] mie[-1] = 4 mie.append(5) // [1, 2, 3, 4, 5] mie.insert(1, 6) // [1, 6,

2017-10-30 17:58:01 256

原创 LeetCode - 24 - Swap Nodes in Pairs(交换链表结点)

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2017-09-07 16:42:51 263

原创 LeetCode - 44 - Wildcard Matching(模式串匹配2

Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover t

2017-09-02 16:03:20 276

原创 LeetCode - 32 - Longest Valid Parentheses(括号匹配)

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", wh

2017-09-02 14:45:11 259

原创 LeetCode - 10 - Regular Expression Matching(模式串匹配

Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input st

2017-09-02 13:44:35 328

原创 构建乘积数组

题目描述给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1]。不能使用除法。class Solution {public: vector multiply(const vector& a) { vector ans(a.size(

2017-08-30 17:45:12 312

原创 快速排序

仅表示提供一种写法,若有错误,感谢各种指出。第一次传参为 quick(a, 0, a.size() - 1)void quick(int a[], int le, int ri){ if (le >= ri) return; int x = a[ri]; int pos = le - 1; for (int i = le; i < ri; ++i) {

2017-08-30 17:21:41 229

原创 堆排序

研究了一下堆排序,也没有想象的那么难嘛以求最大的k个数为例。class Solution {public: vector<int> GetLeastNumbers_Solution(vector<int> input, int k) { vector<int> ans; if (input.size() ...

2017-08-30 17:16:27 230

原创 求n个数中两数异或的最大值(字母树)

#include #include #include #include #include #include #include #include #include #define INF 0x3f3f3f3f3f3f3fusing namespace std;const int MAXN = 2e5 + 10;int node;int next[MAXN][2];int

2017-08-13 16:42:08 2014

原创 求一个数组中右边第一个比他大的数(单调栈)

题意思路如标题int main(){ int n; cin >> n; int a[MAXN]; for (int i = 0; i < n; ++i) { cin >> a[i]; } int dp[MAXN]; int mie[MAXN]; memset(dp, 0, sizeof(dp)); mem

2017-08-13 16:05:45 2562 1

原创 LeetCode - 378 - Kth Smallest Element in a Sorted Matrix

Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.Note that it is the kth smallest element in the sorted order, not

2017-08-11 18:56:10 212

原创 LeetCode - 91 - Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total nu

2017-08-11 18:26:29 218

原创 LeetCode - 49 - Group Anagrams

Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["nat","tan"], ["bat"]]Note: Al

2017-08-11 17:33:43 212

原创 LeetCode - 22 - Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "(())()", "()(())

2017-08-11 17:16:07 193

原创 LeetCode - 395 - Longest Substring with At Least K Repeating Characters

Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times.Example 1:Input:s = "aaabb", k =

2017-08-11 17:06:02 234

原创 LeetCode - 242 - Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Note:You may ass

2017-08-10 18:00:49 194

原创 LeetCode - 344/541/557 - Reverse String

344. Reverse StringWrite a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".反转一个字符串。时间复杂度O(n),空间复杂度O(1)class Soluti

2017-08-10 17:50:00 214

原创 LeetCode - 412 - Fizz Buzz

Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.

2017-08-10 16:59:25 208

原创 LeetCode - 387 - First Unique Character in a String

Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"return 0.s = "loveleetcode",return 2.Note: 

2017-08-10 16:52:33 245

原创 LeetCode - 322 - Coin Change

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 need to make up that amount. If that amount of money

2017-08-10 16:44:30 169

原创 LeetCode - 328 - Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in

2017-08-10 15:43:28 163

原创 LeetCode - 371 - Sum of Two Integers

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.不用+-法计算两数的和我们用 & 可以得到二进制位上哪些位置需要进位carry因为相加进位后该位置为0

2017-08-10 15:28:58 154

原创 LeetCode - 227 - Basic Calculator II

Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should

2017-08-10 15:06:56 207

原创 LeetCode - 238 - Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O

2017-08-10 10:03:59 165

原创 LeetCode - 179 - Largest Number

Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result may be ve

2017-08-09 18:55:04 193

原创 leetCode - 162 - Find Peak Element

A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, in

2017-08-09 18:38:23 188

原创 LeetCode - 150 - Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1",

2017-08-09 18:20:45 192

原创 LeetCode - 131 - Palindrome Partitioning

Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return[ ["aa","b"],

2017-08-08 18:21:50 147

原创 LeetCode - 125 - Valid Palindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a

2017-08-08 18:21:34 169

原创 LeetCode - 78 - Subsets(求数组全部子集)

Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example,If nums = [1,2,3], a solution is:[ [3], [1],

2017-08-08 18:21:18 373

原创 LeetCode - 79 - Word Search

Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically

2017-08-08 18:20:55 200

原创 LeetCode - 75 - Sort Colors

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers

2017-08-08 18:20:44 167

原创 LeetCode - 55 - Jump Game

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.Determine i

2017-08-08 18:20:32 166

原创 LeetCode - 54/59 - Spiral Matrix(旋转打印数组)

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]

2017-08-08 18:20:20 606

原创 数组中的逆序对

题目描述在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。输入一个数组,求出这个数组中的逆序对的总数P。并将P对1000000007取模的结果输出。 即输出P%1000000007输入描述:题目保证输入的数组中没有的相同的数字数据范围: 对于%50的数据,size 对于%75的数据,size 对于%100的数据,size示例1输入

2017-08-07 17:13:44 176

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除