- 博客(85)
- 收藏
- 关注
原创 Leetcode Merge Two Sorted Lists 日常刷题
/*** Definition for singly-linked list.* struct ListNode {* int val;* ListNode *next;* ListNode(int x) : val(x), next(NULL) {}* };*/class Solution{public: ListNode* ...
2019-05-01 16:37:47
233
原创 LeetCode Valid Parentheses 日常刷题
#include <iostream> #include <stack> #include <string> using namespace std;class Solution {public: bool isValid(string s) { stack<char> temp; ...
2019-04-30 01:12:19
111
原创 Leetcode Remove Nth Node From End of List 日常刷题
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* rem...
2019-04-28 20:29:53
105
原创 Leetcode Letter Combinations of a Phone Number 日常刷题
#include<iostream>using namespace std;#include<vector>#include<string>class Solution {public: vector<string> letterCombinations(string digits) { vector<string>...
2019-04-28 02:26:26
116
原创 Leetcode 3Sum Closest 日常刷题
#include<iostream>using namespace std;#include<algorithm>#include<cmath>#include<vector>class Solution {public: int threeSumClosest(vector<int>& nums, int ...
2019-04-25 16:59:21
87
原创 Leetcode 4Sum 日常刷题
#include<iostream>using namespace std;#include<vector>#include<algorithm>class Solution { //先确定第一和第二个元素,再用双指针的方法从两边向中间夹的方法确定第三和第四个元素!public: vector<vector&l...
2019-04-24 02:32:07
75
原创 Leetcode 3Sum 日常刷题
#include<iostream>using namespace std;#include<algorithm>#include<vector>class Solution {public: vector<vector<int>> threeSum(vector<int>& nums) { sort...
2019-04-23 02:02:20
77
原创 Leetcode Longest Common Prefix 日常刷题
#include<iostream>using namespace std;#include<string>#include<vector>#include<algorithm>class Solution {public: string longestCommonPrefix(vector<string>& st...
2019-04-22 01:22:09
93
原创 Leetcode Roman to Integer 日常刷题
#include<iostream>using namespace std;#include<unordered_map>class Solution {public: int romanToInt(string s) { int res=0; unordered_map<char,int> Map = { {'I', 1}, {'V', 5...
2019-04-21 02:27:04
94
原创 LeetCode Integer to Roman 日常刷题
#include<iostream>using namespace std;#include<string>class Solution {public: string intToRoman(int num) { string str=""; string str_1[14] = { "M","CM","D","CD","C","XC","L","XL"...
2019-04-21 02:02:38
82
原创 leetcode Container With Most Water 日常刷题
class Solution {public: int maxArea(vector<int>& height) { int x = 0, y = height.size() - 1; int res = 0; while (x < y) { res = max(res, (y - x)*min(height[x], heig...
2019-04-17 08:56:58
67
原创 leetcode String to Integer (atoi) 日常刷题
#include<iostream>#include<string>using namespace std;class Solution {public: int myAtoi(string str) { long long res = 0; bool flag; //用flag来判断正负数! int nl = 0; if (str.e...
2019-04-15 18:54:17
67
原创 关于如何用大数据做“用户画像”调查报告(持续更新)
关于如何用大数据做“用户画像”调查报告(持续更新)什么是用户画像 用户画像又称用户角色,作为一种勾画目标用户、联系用户诉求与设计方向的有效工具,用户画像在各领域得到了广泛的应用。我们在实际操作的过程中往往会以最为浅显和贴近生活的话语将用户的属性、行为与期待联结起来。作为实际用户的虚拟代表,用户画像所形成的用户角色并不是脱离产品和市场之外所构建出来的...
2019-04-15 03:02:46
8303
1
原创 爬虫学习记录(持续更新)
爬虫学习记录(持续更新) 1、爬虫:以前对爬虫的理解非常浅显,只是知道爬虫是一门非常高超的技术,甚至有点被它的神秘吓到。但是随着自己对计算机方面的深入学习,掌握了一些代码知识后,然后了解了爬虫的真实面目。(网络爬虫被称为网页蜘蛛,网络机器人,在FOAF社区中间,更经常的称为网页追逐者),是一种按照一定的规则,自动地抓...
2019-04-14 23:06:08
137
原创 有关矩阵的整理(持续更新)
有关矩阵的整理(持续更新)特征值: 特征值是线性代数中的一个重要概念。在数学、物理学、化学、计算机等领域有着广泛的应用。设 A 是n阶方阵,如果存在数m和非零n维列向量x,使得 Ax=mx 成立,则称 m 是A的一个特征值(characteristic value)或本征值(eigenval...
2019-04-14 21:53:39
1003
原创 2018年论文《Listing Embeddings in Search Ranking》笔记
论文《Listing Embeddings in SearchRanking》笔记——论文发表时间:2018年——(Airbnb爱彼迎房源排序中的嵌入(Embedding)技术)——作者:By Mihajlo Grbovic, Haibin Cheng, Qing Zhang, Lynn Yang, Phillippe Siclait a...
2019-04-13 18:57:46
405
原创 leetcode ZigZag Conversion 日常刷题
Leetcode ZigZag Conversion观察规律可得:当 n = 2 时:0 2 4 6 8 A C E1 3 5 7 9 B D F当 n = 3 时:0 4 8 C13579BDF2 6 A E当 n = 4 时:0 6 C1 57 BD24 ...
2019-04-13 14:42:30
258
原创 LeetCode Longest Palindromic Substring 日常刷题
class Solution {public: string longestPalindrome(string s) { string t = "$#"; for (int i = 0; i < s.size(); ++i) { t += s[i]; t += '#'; } //利用了 M...
2019-04-12 01:44:26
69
原创 leetcode Median of Two Sorted Arrays 日常打卡
class Solution {public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int len1 = nums1.size(); int len2 = nums2.size(); int len = len1 + len2; ...
2019-04-10 23:43:00
86
原创 LeetCode Reverse Integer 日常刷题
class Solution {public: int reverse(int x) { int ret = 0; while (x != 0) { // handle overflow/underflow if (abs(ret) > 214748364) return 0; re...
2019-04-08 16:15:04
71
原创 leetcode Palindrome Number 日常刷题
class Solution {public: bool isPalindrome(int x) { if(x<0) return false; //负数不算回文数 int temp=0, y=x; while(y) { if(abs(temp)>(INT_MAX/10)) return false...
2019-04-08 16:10:51
45
原创 leecode Add Two Numbers 日常刷题
/*** Definition for singly-linked list.* struct ListNode {* int val;* ListNode *next;* ListNode(int x) : val(x), next(NULL) {}* };*/class Solution {public: ListNode* ad...
2019-04-06 15:38:52
82
原创 leetcode Two Sum 日常刷题
#include<iostream>using namespace std;#include<vector>class Solution{public: vector<int> twoSum(vector<int>& nums, int target) { int work = 0; ...
2019-04-06 15:31:58
68
原创 leectcode Longest Substring Without Repeating Ch 日常刷题
#include<iostream>using namespace std;#include<string>class Solution {public: int lengthOfLongestSubstring(string s) { int count = 0; int start = 0; int lon...
2019-04-06 14:40:41
66
原创 寒假训练
#include<iostream>using namespace std;int main(){ int n, m; cin >> n >> m; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (i % 2 == 1) cout <...
2019-01-29 23:41:24
90
原创 寒假训练
#include<iostream>using namespace std;int main(){ int a[35][2],n,cnt; while (cin >> n) { cnt = 0; for (int i = 0; i < n; i++) { cin >> a[i][0] >> a[i][1]; ...
2019-01-29 23:40:58
60
原创 寒假训练
#include<iostream>using namespace std;int gcd(int a, int b){ if (b == 0) return a; return gcd(b, a%b);}int main(){ int work,a,b,n; while (cin>>a>>b>>n) { while (n...
2019-01-29 23:40:28
64
原创 寒假训练
#include<iostream>using namespace std;int main(){ long long a[21], b[21],n,m,nl; a[0] = 1; a[1] = 1; b[0] = 0; b[1] = 0; b[2] = 1; b[3] = 2; for (int i = 2; i < 21; i++) { a[i] = a[...
2019-01-29 23:40:00
78
原创 寒假训练
#include<iostream>using namespace std;long long dp[40][40]; int main(){ int n; int k = 1; dp[1][-1] = 1; for (int i = 0; i < 40; i++) { for (int j = 0; j <= i; ...
2019-01-29 23:39:23
56
原创 寒假训练
#include<iostream>using namespace std;char a[101][101];int m, n;void dfs(int i, int j){ if (a[i][j] != '@'|| i < 0 || j < 0 || i >= m || j >= n) return; else { a[i][j] = '...
2019-01-29 23:38:52
75
原创 寒假训练
#include <iostream>using namespace std;double C(int m, int n){ double i, cn = 1, cm = 1, cc = 1; for (i = 1; i <= n; i++) cn *= i; for (i = 1; i <= m; i++) cm *= i; for (i = 1;...
2019-01-29 23:38:19
69
原创 寒假训练
#include <iostream>using namespace std;double C(int m, int n){ double i, cn = 1, cm = 1, cc = 1; for (i = 1; i <= n; i++) cn *= i; for (i = 1; i <= m; i++) cm *= i; for (i = 1;...
2019-01-29 23:37:27
71
原创 寒假训练
#include<iostream>#include<string>#include <set>using namespace std;int main(){ string s; set<char> t; int nl; while (cin >> s) { nl = s.length(); for (int...
2019-01-29 23:36:45
65
原创 寒假训练
#include<iostream>using namespace std;int main(){ int a, b,work=0; cin >> a >> b; int *p = new int[a]; for (int i = 1; i < a; i++) { cin >> p[i]; } for (int i =...
2019-01-29 23:34:24
71
原创 寒假训练:Virgo's Trial G - 7
#include<iostream>using namespace std;char a[101][101];int m, n;void dfs(int i, int j){ if (a[i][j] != '@'|| i < 0 || j < 0 || i >= m || j >= n) return; else { a[i][j] = '...
2019-01-23 22:05:49
66
原创 寒假训练:Virgo's Trial A - 1
#include<iostream>using namespace std;int main(){ int a; while (cin >> a) { if (a <= 5) cout << "1" << endl; else if (a % 5 == 0) cout << a / 5 <&l...
2019-01-22 19:00:52
102
原创 寒假训练:Virgo's Trial B - 2
#include<iostream>using namespace std;#include<string>int main(){ int nl; string str1, str2; while (cin >> str1 >> str2) { nl = str1.length(); for (int i = 0; i &l...
2019-01-22 18:59:32
89
原创 寒假训练:Virgo's Trial C - 3
#include <iostream>using namespace std;int main(){ int n, ans = 0,a[100005]; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; ans += (a[i] == a[i - 1] ? 0 : 1); ...
2019-01-22 18:58:08
84
原创 寒假训练:Virgo's Trial E - 5
#include<iostream>using namespace std;#include<algorithm>int main(){ int n, i; int p1, p2, p3, p4; p1 = p2 = p3 = p4 = 1; int p[6000] = { 0 }, a[4] = {0}; p[1] = 1; for (i = 2; ...
2019-01-22 17:58:13
78
原创 寒假训练:Leo's Trial D - 4
#include<algorithm>#include <iostream>#include <cstdio>using namespace std;int main(){ int a[200005]; int sum[200005]; int dp[200005]; int r, c; while (scanf_s("%d%d", &a...
2019-01-21 17:44:45
96
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人