自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(924)
  • 资源 (1)
  • 收藏
  • 关注

原创 从数学角度看基金定投

基金定投作为很多人推荐的投资理财方案,今天我们就从数学的角度来看看,为什么基金定投会受到大家的吹捧?以及定投的策略是怎么样的!​1.是什么基金定投每日/周/月用固定数目的资金买入某只基金。2. 为什么基金定投基金有涨有跌,让我们先用一个简单的模型来建模,如下,第一天基金每份净值是1元,第二天跌到了0.5元,第三天又涨回了1元。基金定投就是这3天每天都定投固定数目的金额,加入每天都定投1元,那到第三天的份额数是1/1+1/0.5+1/1=4份,如果在第三天卖出的话,就可以收..

2021-02-22 11:00:43 1006 3

原创 图片上色(有demo体验)

早期的老照片都是黑白的,通过AI技术能自动给它们上色,先来看下原理。原理基本原理就是encoder-decoder架构,然后加上一些GAN training技巧,可以使得生成的图片更加真实。代码可见https://github.com/jantic/DeOldify​github.com值得一提的是,这里用的不是传统的GAN,传统GAN会把Generator和Discriminator放到一起end2end train,这里用了一种称之为"NoGAN"的技巧,这种技巧能使得生成的图片更少的局部瑕疵。.

2021-01-30 12:43:08 700

原创 LeetCode题解更新到微信公众号了

欢迎感兴趣的朋友关注!会不定期更新LeetCode Contest题解,也会对同类型问题进行归纳总结。

2020-05-18 23:25:00 412

原创 2218. Maximum Value of K Coins From Piles

There arenpilesof coins on a table. Each pile consists of apositive numberof coins of assorted denominations.In one move, you can choose any coin ontopof any pile, remove it, and add it to your wallet.Given a listpiles, wherepiles[i]is a list...

2022-05-01 10:44:39 300

原创 大数据分析资料

python各种例子(比看书强100倍)https://github.com/apache/spark/tree/v3.1.1-rc3/examples/src/main/python python实现协同过滤https://blog.csdn.net/weixin_35576881/article/details/84431930 spark语法https://github.com/databricks/learning-spark/tree/master/src/python...

2021-04-20 18:20:11 184

原创 C++ debug

#include <bits/stdc++.h>using namespace std;int main() { unordered_map<char, vector<int> > before; vector<int> tmp = {1,2,3};// cout<<tmp[0]<<endl; before['A'] = tmp; cout << "done" ; re.

2021-04-04 11:57:00 470

原创 1739. Building Boxes

You have a cubic storeroom where the width, length, and height of the room are all equal tonunits. You are asked to placenboxes in this room where each box is a cube of unit side length. There are however some rules to placing the boxes:You can place...

2021-02-09 21:02:08 253

原创 1718. Construct the Lexicographically Largest Valid Sequence

Given an integern, find a sequence that satisfies all of the following:The integer1occurs once in the sequence. Each integer between2andnoccurs twice in the sequence. For every integeribetween2andn, thedistancebetween the two occurrences ...

2021-01-12 21:17:47 185

原创 1717. Maximum Score From Removing Substrings

You are given a stringsand two integersxandy. You can perform two types of operations any number of times.Remove substring"ab"and gainxpoints. For example, when removing"ab"from"cabxbae"it becomes"cxbae". Remove substring"ba"and gain...

2021-01-12 21:15:45 171

原创 1723. Find Minimum Time to Finish All Jobs

You are given an integer arrayjobs, wherejobs[i]is the amount of time it takes to complete theithjob.There arekworkers that you can assign jobs to. Each job should be assigned toexactlyone worker. Theworking timeof a worker is the sum of the t...

2021-01-10 20:29:43 283

原创 1722. Minimize Hamming Distance After Swap Operations

You are given two integer arrays,sourceandtarget, both of lengthn. You are also given an arrayallowedSwapswhere eachallowedSwaps[i] = [ai, bi]indicates that you are allowed to swap the elements at indexaiand indexbi(0-indexed)of arraysource. ...

2021-01-10 20:21:44 168

原创 LeetCode 0~200 Medium好题

首发于微信公众号公众号链接太复杂说明的题,面试不考;太easy,太tricky的题也不收录。11.Container With Most Water33.Search in Rotated Sorted Array​55.Jump Game94.Binary Tree Inorder Traversal109.Convert Sorted List to Binary Search Tree137.Single Number II11.Con...

2021-01-07 18:46:34 144

原创 1443. Minimum Time to Collect All Apples in a Tree

Given an undirected tree consisting ofnvertices numbered from 0 ton-1, which has some apples in theirvertices. You spend 1 second to walk over oneedge of the tree.Return the minimum time in secondsyou have to spendin order to collect all apples in ...

2020-05-12 23:50:14 395

原创 1442. Count Triplets That Can Form Two Arrays of Equal XOR

Given an array ofintegersarr.We want to select three indicesi,jandkwhere(0 <= i < j <= k < arr.length).Let's defineaandbas follows:a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1] b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]Note that^...

2020-05-12 23:49:10 260

原创 1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows

You are given anm* nmatrix,mat, and an integerk,whichhas its rows sorted in non-decreasingorder.You are allowed to choose exactly 1 element from each row to form an array.Return the Kthsma...

2020-05-05 22:28:59 439

原创 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

Given anarray of integersnumsand anintegerlimit, return the size of the longest continuous subarray such that the absolute difference between any two elements is less than or equal tolimit.In ...

2020-05-05 22:28:01 414

原创 1434. Number of Ways to Wear Different Hats to Each Other

There arenpeopleand 40 types of hats labeled from 1 to 40.Given a list of list of integershats, wherehats[i]is a list of all hats preferredby thei-thperson.Return the number of ways that ...

2020-05-05 11:22:35 355

原创 1425. Constrained Subsequence Sum

Given an integer arraynumsand an integerk, return the maximum sum of anon-emptysubsequenceof that array such that for everytwoconsecutiveintegers in the subsequence,nums[i]andnums[j], wher...

2020-05-01 22:24:50 400

原创 1424. Diagonal Traverse II

Given a list of lists of integers,nums,return all elements ofnumsin diagonal order as shown in the below images.Example 1:Input: nums = [[1,2,3],[4,5,6],[7,8,9]]Output: [1,4,2,7,5,3,...

2020-05-01 22:23:16 328

原创 1419. Minimum Number of Frogs Croaking

Given the stringcroakOfFrogs, which represents a combination of the string "croak" from different frogs, that is, multiple frogs can croak at the same time, so multiple “croak” are mixed.Return the ...

2020-04-25 16:48:02 269

原创 1420. Build Array Where You Can Find The Maximum Exactly K Comparisons

Given three integersn,mandk. Consider the following algorithm to find the maximum element of an array of positive integers:You should build the array arr which has the following properties:...

2020-04-25 16:47:55 351

原创 1416. Restore The Array

A program was supposed to print an array of integers. The program forgot to print whitespaces and the array is printed as a string of digits and all we know is that all integers in the array were in t...

2020-04-21 21:03:09 537 1

原创 1415. The k-th Lexicographical String of All Happy Strings of Length n

Ahappy stringis a string that:consists only of letters of the set['a', 'b', 'c']. s[i] != s[i + 1]for all values ofifrom1tos.length - 1(string is 1-indexed).For example, strings"abc", "...

2020-04-21 21:02:29 351

原创 1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K

Given the numberk,return the minimum number of Fibonacci numbers whose sum is equal tok, whether a Fibonacci number could be used multiple times.The Fibonacci numbers are defined as:F1= 1 F2...

2020-04-21 20:59:45 447

原创 1411. Number of Ways to Paint N × 3 Grid

You have agridof sizen x 3and you want to paint each cell of the grid with exactlyone of the three colours:Red,YelloworGreenwhile making sure that no two adjacent cells havethe same colour ...

2020-04-12 13:14:05 276

原创 1406. Stone Game III

Alice and Bob continue theirgames with piles of stones. There are several stonesarranged in a row, and each stone has an associatedvalue which is an integer given in the arraystoneValue.Alice an...

2020-04-07 22:00:18 188

原创 1405. Longest Happy String

A string is calledhappyif it doesnot have any of the strings'aaa','bbb'or'ccc'as a substring.Given three integersa,bandc, returnanystrings,which satisfies following conditions:sis...

2020-04-07 21:59:29 247

原创 1404. Number of Steps to Reduce a Number in Binary Representation to One

Given a numbersin their binary representation. Return the number of steps to reduce it to 1 under the following rules: If the current number is even, you have to divide it by 2. If the curre...

2020-04-07 21:58:28 252

原创 1392. Longest Happy Prefix

A string is called ahappy prefixif is anon-emptyprefix which is also a suffix (excluding itself).Given a strings. Return thelongest happy prefixofs.Return an empty string if no such prefi...

2020-03-25 22:45:35 288

原创 1388. Pizza With 3n Slices

There is a pizza with 3n slices of varying size, you and your friends will take slices of pizza as follows:You will pickanypizza slice. Your friend Alicewill picknext slice in anti clockwise di...

2020-03-24 21:20:58 441

原创 1387. Sort Integers by The Power Value

The power of an integerxis defined as the number of steps needed to transformxinto1using the following steps:ifxis even thenx = x / 2 ifxis odd thenx = 3 * x + 1For example, the power ...

2020-03-24 21:17:27 570

原创 1383. Maximum Performance of a Team

There arenengineers numbered from 1 tonandtwo arrays:speedandefficiency, wherespeed[i]andefficiency[i]represent the speed and efficiency for the i-th engineer respectively.Return the maxim...

2020-03-24 21:12:16 280

原创 1373. Maximum Sum BST in Binary Tree

Given abinary treeroot, the task is to return the maximum sum of all keys ofanysub-tree which is also a Binary Search Tree (BST).Assume a BST is defined as follows:The left subtree of a node c...

2020-03-16 22:05:42 342

原创 1372. Longest ZigZag Path in a Binary Tree

Given a binary treeroot, aZigZag path for a binary tree is defined as follow:Chooseanynode in the binary tree and a direction (right or left). If the current direction is right then move to the...

2020-03-16 22:05:08 249

原创 1371. Find the Longest Substring Containing Vowels in Even Counts

Given the strings, return the size of the longest substring containing each vowel an even number of times. That is, 'a', 'e', 'i', 'o', and 'u' must appear an even number of times.Example 1:I...

2020-03-16 22:04:29 235

原创 1370. Increasing Decreasing String

Given a strings. You should re-order the string using the following algorithm:Pick thesmallestcharacter fromsandappendit to the result. Pick thesmallestcharacter fromswhich is greater th...

2020-03-16 22:03:49 398

原创 1359. Count All Valid Pickup and Delivery Options

Givennorders, each order consist in pickup and delivery services.Count all valid pickup/delivery possible sequences such that delivery(i) is always after ofpickup(i).Since the answermay be t...

2020-02-29 19:25:29 341

原创 1358. Number of Substrings Containing All Three Characters

Given a stringsconsisting only of charactersa,bandc.Return the number of substrings containingat leastone occurrence of all these charactersa,bandc.Example 1:Input: s = "abcabc"...

2020-02-29 19:24:46 318

原创 1349. Maximum Students Taking Exam

Given am* nmatrixseatsthat represent seats distributionsin a classroom.If a seatisbroken, it is denoted by'#'character otherwise it is denoted by a'.'character.Students can see the ans...

2020-02-28 22:08:09 332

原创 1344. Jump Game V

Given an array ofintegersarrand an integerd. In one step you can jump from indexito index:i + xwhere:i + x < arr.lengthand0 <x <= d. i - xwhere:i - x >= 0and0 <x <...

2020-02-02 16:31:02 172

XGboost官方介绍

XGboost官方介绍

2021-01-07

空空如也

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

TA关注的人

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