最新 最热

Array - 219. Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute d...

2020-09-23
1

Array - 121. Best Time to Buy and Sell Stock

Say you have an array for which the _i_th element is the price of a given stock on day i.

2020-09-23
1

Array - 123. Best Time to Buy and Sell Stock III

Say you have an array for which the _i_th element is the price of a given stock on day i.

2020-09-23
0

Array - 334. Increasing Triplet Subsequence

Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.

2020-09-23
1

Array - 209. Minimum Size Subarray Sum

Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't one, retur...

2020-09-23
1

Array - 238. Product of Array Except Self

Given an array nums of n integers where n > 1,  return an array output such that output[i] is equal to the product of all the elements of numsexcept nums[i].

2020-09-23
1

组合数学-抽屉原理

抽屉原理又称鸽巢原理:把 n+1个物品放进 n个盒子里,那么至少有一个盒子包含两个及以上的物品。

2020-09-15
1

数论-素数

若两个素数相差2则称为一对孪生素数,求区间[1,n]内的孪生素数个数。 筛法素数打表,然后判断孪生,用前缀和记录。

2020-09-15
1

数论-同余与逆元

将一个数拆成若干数,求其乘积最大。 先上结论:一个数n拆成m个数使其乘积最大,则拆成m个n/m;如果nm不整除则拆成一段连续自然数(从2开始,剩下的往前摊);如果不限制m,则拆成最多的3,剩下的拆成2。证明参考 这题要求数不能相同,所...

2020-09-15
1

动态规划-数位DP

文章目录数位DP例题HDU-2089法一、递推公式法二、记忆化搜索HDU-3555法一法二数位DP----image.png例题----HDU-2089HDU-2089 不要62 Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。......

2020-09-15
1