上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 47 下一页
摘要: 题目传送门 1 /* 2 比C还水。。。 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 typedef long long ll;12 13 const... 阅读全文
posted @ 2015-05-21 21:49 Running_Time 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:每棵树给出坐标和高度,可以往左右倒,也可以不倒 3 问最多能砍到多少棵树 4 DP:dp[i][0/1/2] 表示到了第i棵树时,它倒左或右或不动能倒多少棵树 5 分情况讨论,若符合就取最大值更新,线性dp,自己做出来了:) 6 */ ... 阅读全文
posted @ 2015-05-21 21:47 Running_Time 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:找到一个字符串p,使得它和s,t的不同的总个数相同 3 贪心:假设p与s相同,奇偶变换赋值,当是偶数,则有答案 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 usi... 阅读全文
posted @ 2015-05-21 21:37 Running_Time 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:5种情况对应对应第i或j辆车翻了没 3 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 4 3: if both cars turned over during the collision. 5 是指i,j两辆车,而不... 阅读全文
posted @ 2015-05-21 21:31 Running_Time 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:比较型号的大小 3 模拟:坑点在长度可能为5,此时设为'A' 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #inc... 阅读全文
posted @ 2015-05-19 16:33 Running_Time 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:表达式转换 3 模拟:题目不难,也好理解题意,就是有坑!具体的看测试样例。。。 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include ... 阅读全文
posted @ 2015-05-19 16:32 Running_Time 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:给n, k,然后允许给某一个数加上k的正整数倍,当然可以不加, 3 问你是否可以把这n个数变成1,2,3,...,n, 可以就输出Jerry, 否则输出Tom。 4 贪心:保存可能变成的值的方案数,当一个符合,其他所有可能方案减1 5 ... 阅读全文
posted @ 2015-05-19 16:30 Running_Time 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 此题为:HDOJ 1233 + HDOJ 1232 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 const int MAX_N = 100 + 10... 阅读全文
posted @ 2015-05-18 20:27 Running_Time 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 最小生成树之kruskal算法--并查集(数据结构)实现 3 建立一个结构体,记录两点和它们的距离,依照距离升序排序 4 不连通就累加距离,即为最小生成树的长度 5 */ 6 #include 7 #include 8 #include 9 #... 阅读全文
posted @ 2015-05-18 20:23 Running_Time 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 并查集(Union-Find)裸题 3 并查集三个函数:初始化Init,寻找根节点Find,连通Union 4 考察:连通边数问题 5 */ 6 #include 7 #include 8 #include 9 #include 10 usin... 阅读全文
posted @ 2015-05-18 19:54 Running_Time 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:两点之间有不同颜色的线连通,问两点间单一颜色连通的路径有几条 3 DFS:暴力每个颜色,以u走到v为结束标志,累加条数 4 注意:无向图 5 */ 6 #include 7 #include 8 #include 9 #include 1... 阅读全文
posted @ 2015-05-18 17:14 Running_Time 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 水题:vector容器实现插入操作,暴力进行判断是否为回文串 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std;11 ... 阅读全文
posted @ 2015-05-18 17:08 Running_Time 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 m数组记录出现的花色和数值,按照数值每5个搜索,看看有几个已满足,剩下 5 - cnt需要替换 3 ╰· 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 using nam... 阅读全文
posted @ 2015-05-17 13:40 Running_Time 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 线段树-成段更新:裸题,成段增减,区间求和 3 注意:开long long:) 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namesp... 阅读全文
posted @ 2015-05-16 10:01 Running_Time 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 线段树-成段更新:第一题!只要更新区间,输出总长度就行了 3 虽然是超级裸题,但是用自己的风格写出来,还是很开心的:) 4 */ 5 #include 6 #include 7 #include 8 #include 9 #incl... 阅读全文
posted @ 2015-05-15 20:56 Running_Time 阅读(118) 评论(0) 推荐(0) 编辑
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 47 下一页