- 博客(22)
- 收藏
- 关注
转载 Codeforces Round #466 (Div. 2)
940A 转化为求一个有序数列中满足条件的最大子集。 1 #include <iostream> 2 #include <algorithm> 3 4 using namespace std; 5 6 int main(){ 7 ios::sync_with_stdio(false); 8 cin.ti...
2018-02-26 21:59:00 103
转载 ST表
1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int st[100000][17]; 5 int meow[100000]; 6 int n; 7 8 void st_init(){ 9 int jmax = floor(log(n)/log(2));10 ...
2018-02-26 21:14:00 112
转载 Wildcard Matching
https://leetcode.com/problems/wildcard-matching/description/状态转移方程考虑s[i]恰与p[j]匹配的两种情况:相等或'?',以及p[j]为'*'的两种情况:s[i]为与'*'匹配的串的子串或'*'匹配一个空串即可。主要功夫花在处理边界上。边界处理格式:(?)*?*。下午研究一下优化。bool isMat...
2017-12-22 12:06:00 78
转载 HDOJ 3549 Dinitz
#include <cstdio>#include <vector>#include <algorithm>#include <cstring>#include <queue>using namespace std;#define N 100#define INF 233333333...
2017-12-15 21:19:00 95
转载 HDOJ 1083 Hungarian实现
1 #include<cstdio> 2 #include<vector> 3 4 using namespace std; 5 6 #define N1 100 7 #define N2 300 8 9 int match[N2];10 vector<int> graph[N1];11 bool v...
2017-12-09 10:56:00 138
转载 HDOJ 1217 Floyd
1 #include <iostream> 2 #include <string> 3 #include <map> 4 5 using namespace std; 6 7 map<string, int> edge; 8 double matrix[30][30]; 9 10 bool fl...
2017-11-28 10:42:00 86
转载 HDOJ 2544 BellmanFord实现
1 #include <cstdio> 2 3 struct road{ 4 int head; 5 int tail; 6 int value; 7 }; 8 9 #define Infinity 23333333310 11 int main(){12 int n, m;13 ...
2017-11-22 16:43:00 83
转载 HDOJ 2544 Dijkstra实现
1 #include <cstdio> 2 #include <queue> 3 #include <cstring> 4 #include <cmath> 5 6 using namespace std; 7 8 #define N 100 9 #define Infinity 233333333...
2017-11-22 16:18:00 82
转载 CashBox
程设课的一个小玩具。 1 /** 2 * Copyright 2017 Neopolitan 3 */ 4 5 #include <cstdio> 6 #include <algorithm> 7 8 using namespace std; 9 10 #define SIZE 100 1...
2017-11-21 20:04:00 145
转载 HDOJ 1879 Prim实现
调试中遇到的困难主要在于building队列的维护。不能简单地将新增edge加入queue,需要对其方向进行处理。 1 #include <cstdio> 2 #include <algorithm> 3 #include <queue> 4 #include <cstring> 5 6 using names...
2017-11-21 11:21:00 121
转载 HDOJ 1879 Kruskal实现
#include <cstdio>#include <algorithm>using namespace std;#define N 100int parent[N];struct road{ int begin; int end; int value;};bool cmp(road...
2017-11-20 17:21:00 74
转载 Longest Consecutive Sequence
Nov, 9, 2017. https://leetcode.com/problemset/algorithms/?topicSlugs=union-find%2Clinked-list Given an unsorted array of integers, find the length of the longest consecutive elements sequence...
2017-11-09 22:23:00 82
转载 Maximal Rectangle
Date: Nov. 8, 2017.Problem: https://leetcode.com/problems/maximal-rectangle/description/Description: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle cont...
2017-11-08 21:16:00 53
转载 Merge k Sorted Lists
Date: Nov, 7, 2017.Problem: https://leetcode.com/problems/merge-k-sorted-lists/discuss/Description: Mergeksorted linked lists and return it as one sorted list. Analyze and describe...
2017-11-07 21:45:00 86
转载 Smallest Range
Date: Nov. 6, 2017Problem: https://leetcode.com/problems/smallest-range/description/Description: You have k lists of sorted integers in ascending order. Find the smallest range that ...
2017-11-06 20:56:00 130
转载 Largest Rectangle in Histogram
Date: Nov. 4, 2017Problem: https://leetcode.com/problems/largest-rectangle-in-histogram/description/Description: Givennnon-negative integers representing the histogram's bar height...
2017-11-04 15:01:00 90
转载 Jump Game II
Date: Nov. 3, 2017Problem: https://leetcode.com/problems/jump-game-ii/description/Description: Given an array of non-negative integers, you are initially positioned at the first inde...
2017-11-03 20:39:00 78
转载 Trapping Rain Water
Date: Nov. 2, 2017Problem: https://leetcode.com/problems/trapping-rain-water/description/Description: Givennnon-negative integers representing an elevation map where the width of e...
2017-11-02 21:45:00 83
转载 First Missing Positive
Date: Nov. 1, 2017Problem: https://leetcode.com/problems/first-missing-positive/description/Description: Given an unsorted integer array, find the first missing positive integer. ...
2017-11-01 20:49:00 59
转载 Median of Two Sorted Arrays
Date: Oct. 31, 2017Problem: https://leetcode.com/problems/median-of-two-sorted-arrays/solution/Description: There are two sorted arraysnums1andnums2of size m and n respectively....
2017-10-31 21:02:00 72
转载 4Sum
Date: Oct 30, 2017Problem: https://leetcode.com/problems/4sum/description/Description: Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d...
2017-10-30 14:40:00 60
转载 Search in Rotated Sorted Array
Date: Oct 29, 2017Problem: https://leetcode.com/problems/search-in-rotated-sorted-array/description/Description: Suppose an array sorted in ascending order is rotated at some pivot u...
2017-10-29 20:45:00 75
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人