- 博客(74)
- 收藏
- 关注
原创 2015腾讯校园实习生招聘后台开发岗位 笔试+一面+二面
笔试腾讯的在线笔试不是在自己的平台上进行的,而是在tencent.ceping.com上进行的。这个平台增加了现场视频的功能,左上角一直有一个你的实时画面跟着你。开始的时候是有一些不适应,但是不用理他,过了一会就好了。腾讯的笔试题相对来说也不算很难。由于我选择的是基础研究岗位,所以我的笔试题多了好多高数和概率论的内容,这是我始料未及的。具体的题目我是记不清了,反正我是做了一个多小时把题目都做完了。总
2015-04-16 17:43:47 999
原创 Mac OS/X Hadoop 2.6 编译安装常见问题总结 / Building Hadoop on OS/X
几点说明最好能有 MacPort 或者其他的 Brew 类似的工具,这样能节省很多的时间。几个必须的工具* Unix System这个是必须的* JDK 1.6+JDK版本不能太高,反正 Hadoop 2.6 在 JDK 1.8 上编译失败好几次,建议用 1.7* Maven 3.0 or later这个也是必须的* Findbugs 1.3.9 (if running findbugs)Find
2015-02-17 23:01:26 850
原创 hsfsd
#include#include#include#include#includeusing namespace std; class Node{ public: int data; Node* next; Node(int data){ next = NULL; this->da
2014-06-18 16:03:37 118
原创 sdfsdf
#include#include#include#includeusing namespace std;class Node {public: int x, y, d; Node* next; Node() { next = NULL; } Node (int x, int y, int d) { this->d
2014-06-18 16:01:59 120
原创 sdfsd
class Node {public: int data; Node* next; Node (int data) { next = NULL; //记录下一节点 this->data = data; //记录火车的编号 }};class Queue { //存放火车的队列private: Node *h
2014-06-18 16:00:47 174
原创 sadas
class Node {public: int x, y, d; Node* next; Node() { next = NULL; } Node (int x, int y, int d) { this->d = d; //入栈时记录这是当前点的第几个方向 this->x = x; //记录行的
2014-06-18 15:59:27 164
原创 fdsfsd
class Node{ public: int x,y,d; Node* next; Node(){next = NULL;} Node(int x,int y,int d){ this->d = d; //入栈时记录这是当前点的第几个方向
2014-06-18 15:58:11 6426
原创 数据结构实验 约瑟夫环的循环链表实现
附代码:/****************************************************** This is a Circular List class* Created by ZhiYu.Wang* Current time: 2014.5.17*************************************************
2014-05-17 10:21:38 687
转载 常用正则表达式大全
正则表达式用于字符串处理、表单验证等场合,实用高效。现将一些常用的表达式收集于此,以备不时之需。匹配中文字符的正则表达式: [\u4e00-\u9fa5]评注:匹配中文还真是个头疼的事,有了这个表达式就好办了匹配双字节字符(包括汉字在内):[^\x00-\xff]评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)匹配空白行的正则表达式:
2014-05-07 15:55:58 292
原创 HDU 3732 Ahui Writes Word 经典动态规划 DP
直接 DP 的话肯定超时因为每个单词的 Complex 和 Value 都不会超过 10 所以里面肯定存在大量的相同价值的物品将相同价值的物品合并后用多重背包解之即可#include #include #include #include #include #include #include #include #include #include #include
2014-04-20 23:25:19 448
原创 HDU 携程编程大赛 1003 携程全球数据中心建设 Prim OR Kruskal
水题先求两两jia#include #include #include #include #include #include #include #include #include #include #include #include #define BUG puts("HERE!")using namespace std;const int MAX = 105;
2014-04-10 21:46:04 550
原创 HDU 4287 Intelligent IME 水题
本想写个字典树结果发现是个水题。。#include #include #include #include #include #include using namespace std;const int MAX = 1000000 + 5;int num[MAX], val[MAX];const int mp[] = {2, 2, 2, 3, 3, 3, 4, 4, 4,
2014-04-05 16:38:54 584
原创 HDU 1811 Rank of Tetris 拓扑排序 AND 并查集
先用并查集把相等的情况合并了再使用拓扑排序找冲突具体是用大的数向小的数建边,然后判断冲突#include #include #include #include #include #include #include #include using namespace std;const int MAX = 10005;const int MAXM = 20005;in
2014-04-03 20:58:01 426
原创 HDU 1598 Find the most comfortable road 二分枚举答案 或 并查集
我是用的二分,这样似乎要慢点并查集的那个没写。。窝真的好菜。。#include #include #include #include #include #include #include using namespace std;const int MAX = 205;const int MAXM = 1005;int spd[MAXM];bool vis[MAX]
2014-04-03 19:37:07 379
原创 【图论】网络流各种题目集锦
最大流POJ 1273 Drainage DitchesPOJ 1274 The Perfect Stall (二分图匹配)POJ 1698 Alice's Chance(构图)POJ 2112 Optimal Milking (二分)POJ 2455 Secret Milking Machine (二分)POJ 3189 Steady Cow Assignment (枚举
2014-03-15 23:08:32 471
原创 POJ 2823 Sliding Window 双端队列 or RMQ or 线段树
本来是道双端队列的题,结果我用RMQ水过待会再看看双端队列的解法吧,反正这俩我都不会。。#include#include#include#include#define min(a,b) (a)<(b)?(a):(b)#define max(a,b) (a)>(b)?(a):(b)using namespace std;const int MAX = 1e6 + 5;int
2014-03-12 11:03:19 525
原创 POJ 3253 Fence Repair (哈夫曼树)Haffman-tree
哈夫曼树的一个题,我用 STL 的优先级队列水过的。can't 弱 any more...贴代码:(AC,172ms)#include #include using namespace std;typedef long long LL;struct node_{ LL x; bool operator < (node_ a) const { re
2013-12-16 19:17:58 510
原创 POJ Hotel 线段树 区间合并
线段树模板题#include #include #include #define lson l, m, rt << 1#define rson m + 1, r, rt << 1 | 1using namespace std;const int MAX = 50000 + 5;int lsum[MAX << 2], rsum[MAX << 2], msum[MAX << 2];
2013-12-13 19:23:47 449
原创 POJ 2528 Mayor's posters 线段树 区间更新 + 简单哈希函数
区间维护是否被覆盖贴代码(AC,110ms)#include #include #include #include #define lson l, m, rt << 1#define rson m + 1, r, rt << 1 | 1using namespace std;const int MAX = 1e5 + 50;bool peo[MAX];int mark[M
2013-12-10 22:03:41 499
原创 HDU 3468 A Simple Problem with Integers 线段树 区间更新
学习阶段,仿着别人的博客写了一个,感谢 notonlysuccess 大大的博文~线段树区间更新,注意 scanf() 函数会读取缓存区的回车 贴代码(AC,2516ms)#include #include #include #define lson l , m , rt << 1#define rson m + 1 , r , rt << 1 | 1using namesp
2013-12-10 17:01:34 336
原创 minCostMaxFlow Template
#include #include #include using namespace std;const int MAXN = 200;const int INF = 0x7fffffff;struct MCMF_{ int head[MAXN], cnt; int pre[MAXN], pos[MAXN]; int dis[MAXN], que[MAXN *
2013-12-06 11:38:55 441
原创 HDU 1532 Drainage Ditches 网络流 模板题
网络流 模板题重新写了一个,更新一下模板。#include #include #include #include using namespace std;const int MAXN = 205;const int MAXM = MAXN * MAXN;const int INF = 0x7ffffff;struct dinic_{ int que[MAXN],
2013-12-04 21:16:44 506
原创 SGU 176 Flow construction 网络流 有上下界限制最小流
1.构建附加网络2.求ss 到 tt 的最大流3.加入 t 到 s 容量为 INF 的边4.再对 ss 到 tt 求一次最大流5.若 ss 和 tt 满流,则 t 到 s 的流量即位最小流6.若 5 不满足,则无可行流#include#include#include#include#include#includeusing namespace std;cons
2013-12-03 21:30:05 500
原创 SGU 194 Reactor Cooling 有上下界的网络流 网络流拆点
无源汇有上下界限制网络流拆点可解设超级源点 ss 和超级汇点 ttdeg[i] = i 点的流入容量和 - i 点的流出容量和若 deg[i] > 0 建立 ss -> i 边权为 deg[i] 的边 强行流出 deg[i] 的流量若 deg[i] tt 边权为 -deg[i] 的边 强行流入 -deg[i] 的流量贴代码(AC,31ms)#include#includ
2013-12-02 16:18:53 519
原创 HDU 3549 Flow Problem 网络流 基础题
DINIC求网络流最大流贴代码(AC,125MS)#include#include#include#include#include#includeusing namespace std;const int INF = 0x7f7f7f7f;const int MAXN = 20;const int MAXM = 1005;int n, m, s, t, cnt;int
2013-12-02 15:08:26 457
原创 HDU 2844 Coins 背包问题之多重背包
求是否可以相加得到某个数可以把价值和体积都设置为子数然后看 dp 结果是否有 dp[i] == i,有就表示可以相加得到,没有则不能。#include #include #include #include #define max(a,b) ((a)>(b) ? (a) : (b))using namespace std;const int MAX = 500 + 5;cons
2013-11-19 19:28:10 651
原创 HDU 1059 Dividing 多重背包问题
多重背包问题,可以把每个东西看成重量为 i 价值为 i 的 n[i] 个物品。然后看是否能否装满一个容量为总价值一半的背包即可!#include #include #include #include using namespace std;const int MAX = 6;const int MAXN = 20000 * 6 + 5;int n[MAX], dp[MAXN]
2013-11-19 15:36:11 769
原创 HDU 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 完全背包
我的第一个完全背包,加油!贴代码(AC,0ms)#include#include#include#includeusing namespace std;const int MAX = 205;int w[MAX], p[MAX], a[MAX], dp[MAX], ap;void zop(int p, int w){ for(int i = ap; i >= p;
2013-11-19 14:47:42 805
原创 HRBEU 1390 帮派 并查集 + 向量偏移
并查集 + 向量偏移附代码(AC,10MS)#include#include#includeusing namespace std;const int MAX = 1e5 + 5;int f[MAX], r[MAX];void init(int n){ for(int i = 1; i <= n; ++i) f[i] = i, r[i] = 0;}
2013-11-13 20:35:11 776
原创 HRBEU 1392 朋友相会 SPFA 最短路
SPFA 求最短路附代码(AC,270MS)#include#include#include#include#includeusing namespace std;const int MAX = 1e3 + 5;const int INF = 0x7fffff;int n, m;int disa[MAX], disb[MAX];struct edge_{ int
2013-11-13 20:33:39 730
原创 HDU 1856 More is better 并查集
题目数据比较水,改天写个离散化的代码;还我一点我要吐槽,为神马ans = ans > res[i] ? ans : res[i];就超时了,而if(ans < res[i]) ans = res[i];就过了呢,他们到底相差多少呢?附我的代码(AC,390MS)#include#include#include#includeusing namespace
2013-11-13 18:25:26 708
原创 HDU 1829 A Bug's Life 并查集 + 向量偏移
带向量偏移的并查集附代码(AC,)#include#include#includeusing namespace std;const int MAX = 2005;int sex[MAX], f[MAX];void init(int n){ for(int i = 1; i <= n; ++i){ f[i] = i; sex[i] =
2013-11-13 17:22:34 670
原创 HDU 1232 畅通工程 并查集
并查集贴代码:(AC,32ms)#include#include#includeusing namespace std;const int MAX = 1e3 + 5;int f[MAX];void init(int n){ for(int i = 1; i <= n; ++i) f[i] = i;}int find(int a){ re
2013-11-13 16:31:22 644
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人