码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
HDU 3342 Legal or Not【拓扑排序】
题意:给出n,m,人的编号为 0到n-1,再给出m个关系,问能不能够进行拓扑排序#include #include #include #include using namespace std;int indegree[1005],queue[1005],head[1005];struct E...
分类:编程语言   时间:2015-02-07 10:18:38    阅读次数:157
hdu 3652 最大流入门
明天再拍一遍 1 #include 2 #include 3 using namespace std; 4 const int N = 210; 5 const int INF = 0x7FFFFFFF; 6 int n,m,map[N][N],path[N],flow[N],start,end.....
分类:其他好文   时间:2015-02-07 10:13:30    阅读次数:98
深搜--1-n的全排列
之前被教过一个next_permutation库函数,是用来实现数的全排列的,具体实现见代码#include#include#includeusing namespace std;int main(){ int a[1000]; int n; while(scanf("%d",&n...
分类:其他好文   时间:2015-02-07 00:29:22    阅读次数:536
UVa 116 Unidirectional TSP(DP)
题意  一个n*m的环形矩阵(第一行和最后一行是相邻的)  从第一列任意位置出发  只能往右上,右,右下3个方向走  求走到第m列经过的的最小数字和 基础DP  横着的数塔问题 #include #define l(x) d[x][j+1] using namespace std; const int N = 105; int n, m, g[N][N], d[N][N], fol[N][N...
分类:其他好文   时间:2015-02-06 23:16:54    阅读次数:435
【HDU】1536 S-Nim
http://acm.hdu.edu.cn/showproblem.php?pid=1536题意:同nim...多堆多询问...单堆n#include using namespace std;bool b[105];int s[105], f[10005];int main() { int k, m...
分类:其他好文   时间:2015-02-06 23:13:23    阅读次数:174
hdu 2441 匈牙利算法求最大独立集
匈牙利算法 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 int n,m,t; 9 int vis[1002],link[1002],line[1002][1002...
分类:编程语言   时间:2015-02-06 23:12:05    阅读次数:193
【HDU】1517 A Multiplication Game
http://acm.hdu.edu.cn/showproblem.php?pid=1517题意:每次乘上2~9。。p>=n时赢..#include #include #include using namespace std;typedef long long ll;map h;ll n;bool ...
分类:其他好文   时间:2015-02-06 23:11:08    阅读次数:159
UVa 11572 (滑动窗口) Unique Snowflakes
滑动窗口挺有意思的,如果符合条件右端点一直向前走,不符合的话,左端点向前走。 1 #include 2 using namespace std; 3 4 set Set; 5 6 const int maxn = 1000000 + 10; 7 int a[maxn]; 8 9 int Sc...
分类:其他好文   时间:2015-02-06 23:10:45    阅读次数:191
【HDU】1850 Being a Good Boy in Spring Festival
http://acm.hdu.edu.cn/showproblem.php?pid=1850题意:同nim...顺便求方案数...#include #include using namespace std;int a[105];int main() { int n; while(scanf("%d"...
分类:编程语言   时间:2015-02-06 23:08:32    阅读次数:172
【HDU】1847 Good Luck in CET-4 Everybody!
http://acm.hdu.edu.cn/showproblem.php?pid=1847题意:同nim..不过只有一堆..每次取2的幂次..即1、2、4....等,n#include using namespace std;int f[1005];int dfs(int n) { if(n==0...
分类:其他好文   时间:2015-02-06 23:08:24    阅读次数:152
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!