http://acm.hdu.edu.cn/showproblem.php?pid=2018 #include <stdio.h> #include <cstring> #include <algorithm> #include <vector> #include <map> #include <a ...
分类:
其他好文 时间:
2020-02-01 16:38:13
阅读次数:
83
http://acm.hdu.edu.cn/showproblem.php?pid=2041 #include <stdio.h> #include <cstring> #include <algorithm> #include <vector> #include <map> #include <a ...
分类:
其他好文 时间:
2020-02-01 16:25:41
阅读次数:
77
http://acm.hdu.edu.cn/showproblem.php?pid=2044 #include <stdio.h> #include <cstring> #include <algorithm> #include <vector> #include <map> #include <a ...
分类:
其他好文 时间:
2020-02-01 16:17:05
阅读次数:
64
分析: 完整代码: // 最长公共子序列 #include <stdio.h> #include <algorithm> using namespace std; const int N = 100; char A[N], B[N]; int dp[N][N]; int main() { freop ...
分类:
其他好文 时间:
2020-02-01 14:15:10
阅读次数:
61
A题 肯定是1越多越好,因为位数越大越大,所以当n是2的倍数的时候,全是1 但是n可能不是n的倍数,此时应该有(n-3)/2个1和1个7,并且7在前面 #include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #i ...
分类:
其他好文 时间:
2020-02-01 12:56:08
阅读次数:
83
74. Search a 2D Matrix Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: $\bullet$I ...
分类:
其他好文 时间:
2020-02-01 10:28:11
阅读次数:
56
"传送门" 题意: 给出$n,n\leq 3000$个互不重合的点,现在将点分为两组,使得不同组中点的距离不等于任何两个在同一组中点的距离。 给出一个分组方案。 思路: 这是一个构造题。 将点按照坐标的奇偶分类,一共只有四类: $$ (0,0),(0,1),(1,0),(1,1) $$ 会发现我们这 ...
分类:
其他好文 时间:
2020-02-01 00:28:52
阅读次数:
91
1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<queue> 5 #include<map> 6 #include<vector> 7 #include<set> 8 #include<string> ...
分类:
其他好文 时间:
2020-01-31 18:49:43
阅读次数:
71
Quora问题:What are the top 10 algorithms of the 20th century? Pratyush Kumar回答: Top Ten Algorithms 1946: The Metropolis Algorithm for Monte Carlo. Throu ...
分类:
编程语言 时间:
2020-01-31 13:55:47
阅读次数:
93
最短路径 1.概念 单源最短路径 单源最短路径实际是计算源点到其他各个顶点的最短路径的长度,常见算法有dijkstra算法 全局最短路径 全局最短路径实际是计算每个源点到其他各个顶点的最短路径的长度,我们可以调用dijkstra算法N次(这样没有Floyd算法快),常见解决全局最短路径的方法是Flo ...
分类:
编程语言 时间:
2020-01-31 10:21:29
阅读次数:
79