码迷,mamicode.com
首页 >  
搜索关键字:es6 let const    ( 43838个结果
POJ 1021 人品题
报告见代码。。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int MAX=105; 8 int dir[4][2]={1,0,-1,0,0,1,0,-1}; 9...
分类:其他好文   时间:2014-06-09 23:04:01    阅读次数:261
hdu 4460
break point 在 边数很少,o(n*m)暴力出奇迹~~~#include#include#include#include#include#include#includeusing namespace std;const int maxn = 1005, maxm = 22222, inf=...
分类:其他好文   时间:2014-06-09 23:00:47    阅读次数:342
nupt1207(重数问题)
1.统计重数及次数。2.hash。%p,若冲突,则向后移动。******************************#include#include#includeusing namespace std;const int maxn=5000000;const int p=1200007;str...
分类:其他好文   时间:2014-06-09 22:34:07    阅读次数:211
对C++ Primer的10.3.9单词转换的思考
#include #include #include #include #include using namespace std;ifstream& open_file(ifstream&,const string&);int main(int argc, char **argv){ map ...
分类:编程语言   时间:2014-06-09 00:04:20    阅读次数:334
[LeetCode OJ] Max Points on a Line—Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
//定义二维平面上的点struct Point{ int x; int y; Point(int a=0, int b=0):x(a),y(b){}};bool operator==(const Point& left, const Point& right){ return...
分类:其他好文   时间:2014-06-08 22:26:17    阅读次数:357
割点 桥 双连通分量模版
求割点 const int maxn = 1010; vector a[maxn], bcc[maxn]; int pre[maxn]; int low[maxn]; bool iscut[maxn]; int bccno[maxn]; int cnt[maxn]; int dfs_clock; int bcc_cnt; int n; struct Edge { int u, v; };...
分类:其他好文   时间:2014-06-08 05:54:36    阅读次数:270
poj 2139 Six Degrees of Cowvin Bacon , floyd
点击打开链接 题意:给定牛的关系图,求其中一头牛与其他牛关系路程之和sum最小,然后输出 sum*100/(n-1) floyd求任意两点间的最短路程 注意: inf不能太大,因为 f[i][k] + f[k][j]  做加法时可能会溢出! #include #include const int maxn = 300 + 5; const int inf = 1<<29; int...
分类:其他好文   时间:2014-06-08 05:07:03    阅读次数:181
Light OJ 1026 Critical Links 求桥
题目来源:Light OJ 1026 Critical Links 题意:输出桥 思路:模版 #include #include #include #include #include using namespace std; const int maxn = 10010; struct Edge { int u, v; Edge(){} Edge(int u, int v):...
分类:其他好文   时间:2014-06-08 04:07:05    阅读次数:235
Light OJ 1291 Real Life Traffic 双连通最少添边数
题目来源:Light OJ 1291 Real Life Traffic 题意:最少添加几条边 可以使全图边双连通 思路:缩点 重新构图 答案就是(叶子节点数+1)/ 2 #include #include #include #include #include using namespace std; const int maxn = 10010; struct Edge { i...
分类:其他好文   时间:2014-06-08 02:57:26    阅读次数:276
多项式的表示
1.多项式的系数存放在数组中 # include # include # define max(x,y) ((x)>(y)?(x):(y)) using namespace std; const int N=100; struct poly { int arr[N]; int mexp; }; void add(poly &a,poly &b,poly &c) { memset(c.ar...
分类:其他好文   时间:2014-06-08 02:17:57    阅读次数:264
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!