原创 1003 Universal Travel Sites (35 分)(C++)

After finishing her tour around the Earth, CYLL is now planning a universal travel sites development project. After a c

原创 1002 Business (35 分)(C++)

As the manager of your company, you have to carefully consider, for each project, the time taken to finish it, the dead

原创 1001 Battle Over Cities - Hard Version (35 分)(C++)

It is vitally important to have all the cities connected by highways in a war. If a city is conquered by the enemy, all

原创 統計學習方法 第四章習題答案

第4章的習題與習題1.1有些相似,建議兩章一起看,關於極大似然估計和貝葉斯估計我在第一章的習題中講解了,可以先看看第一章的解答。 第一章習題是在伯努利試驗中做貝葉斯估計時,採用的是β\betaβ分佈,但是本章是多個結果的試驗,例如

原创 統計學習方法 第一章習題答案

習題1涉及極大似然估計和貝葉斯估計,可以先看看書的第4章相關內容。 極大似然估計與貝葉斯估計 符號 含義 D 測試數據 θ\thetaθ 待估計的參數 p(θ)p(\theta)p(θ) 先驗概率 p(θ

原创 統計學習方法 第三章習題解答

3.1 題目:參照圖3.1,在二維空間中給出實例點,畫出k爲1和2時的k近鄰法構成的空間劃分,並對其進行比較,體會k值選擇與模型複雜度及預測準確率的關係。 答:本題的意思我理解蠻久(汗-_-||),簡單來講,將一整塊的空間分割成各

原创 統計學習方法 第二章習題答案

2.1 題目:Minsky與Papert指出:感知機因爲是線性模型,所以不能表示複雜的函數,如異或(XOR),驗證感知機爲什麼不能表示異或。 答:即證明異或邏輯是線性不可分的 異或邏輯表 x1x_{1}x1​ x2x_{2}

原创 LeetCode90. Subsets II(C++)

Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: 

原创 LeetCode93. Restore IP Addresses(C++)

Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: In

原创 LeetCode88. Merge Sorted Array(C++)

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elemen

原创 LeetCode 148. Sort List(C++)

Sort a linked list in O(n log n) time using constant space complexity. Example 1: Input: 4->2->1->3 Output: 1->2->3->4

原创 LeetCode79. Word Search(C++)

Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentia

原创 LeetCode71. Simplify Path(C++)

Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path. In a

原创 LeetCode64. Minimum Path Sum(C++)

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum

原创 LeetCode43. Multiply Strings(C++)

Given two non-negative integers num1 and num2 represented as strings, return the product of num1and num2, also represen