This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param a | |
| * @return maxsum | |
| * @brief 最大相连子序列和的 O(n^2) 算法 | |
| */ | |
| int maxSubSum2(const vector<int> &a) { | |
| int maxSum = 0; | |
| for (int i = 0; i < a.size(); ++i) { | |
| int thisSum = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param a | |
| * @return maxsum | |
| * @brief 最大相连子序列和的 O(n^3) 算法 | |
| */ | |
| int maxSubSum1(const vector<int> &a) { | |
| int maxSum = 0; | |
| for (int i = 0; i < a.size(); ++i) | |
| for (int j = i; j < a.size(); ++j) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template <typename Comparable> | |
| int binarySearch(const vector<Comparable>& a, const Comparable& x) { | |
| int low = 0, high = a.size() - 1; | |
| while (low <= high) { | |
| int mid = (low + high) / 2; | |
| if (a[mid] < x) | |
| low = mid + 1; | |
| else(a[mid] > x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| from matplotlib import pyplot as plt | |
| import numpy as np | |
| from sklearn.cluster import * | |
| from sklearn import mixture | |
| from sklearn import metrics | |
| from scipy.stats import mode | |
| class ImgProcessor: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - Power Mode II | |
| - KeyPromoter |
NewerOlder