随笔分类 -  /* 圣人不死 AC不止!*/

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 32 下一页
coding不息!
摘要:题目传送门 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 阅读(119) 评论(0) 推荐(0)
摘要:题目传送门 1 /* 2 题意:每棵树给出坐标和高度,可以往左右倒,也可以不倒 3 问最多能砍到多少棵树 4 DP:dp[i][0/1/2] 表示到了第i棵树时,它倒左或右或不动能倒多少棵树 5 分情况讨论,若符合就取最大值更新,线性dp,自己做出来了:) 6 */ ... 阅读全文
posted @ 2015-05-21 21:47 Running_Time 阅读(200) 评论(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 阅读(132) 评论(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 阅读(189) 评论(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 阅读(173) 评论(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 阅读(178) 评论(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 阅读(162) 评论(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 阅读(154) 评论(0) 推荐(0)
摘要:题目传送门 1 /* 2 最小生成树之kruskal算法--并查集(数据结构)实现 3 建立一个结构体,记录两点和它们的距离,依照距离升序排序 4 不连通就累加距离,即为最小生成树的长度 5 */ 6 #include 7 #include 8 #include 9 #... 阅读全文
posted @ 2015-05-18 20:23 Running_Time 阅读(121) 评论(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 阅读(185) 评论(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 阅读(127) 评论(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 阅读(139) 评论(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 阅读(245) 评论(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 阅读(149) 评论(0) 推荐(0)
摘要:题目传送门 1 /* 2 线段树-成段更新:第一题!只要更新区间,输出总长度就行了 3 虽然是超级裸题,但是用自己的风格写出来,还是很开心的:) 4 */ 5 #include 6 #include 7 #include 8 #include 9 #incl... 阅读全文
posted @ 2015-05-15 20:56 Running_Time 阅读(123) 评论(0) 推荐(0)
摘要:题目传送门 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int MAX_N = 100000 + 10; 7 int cnt[MAX_N]; 8 int ans[MAX_N]; 9 in... 阅读全文
posted @ 2015-05-15 18:28 Running_Time 阅读(120) 评论(0) 推荐(0)
摘要:题目传送门 1 #include 2 #include 3 #define lson l, m, rt > 1 % 5 == 3)12 sum[rt] += sum[rt >> 1];13 if (rt >>1 | 1 % 5 == 3)14 sum[rt... 阅读全文
posted @ 2015-05-15 18:08 Running_Time 阅读(166) 评论(0) 推荐(0)
摘要:题目传送门 1 #include 2 #include 3 #define lson l, m, rt > 1;23 build (lson);24 build (rson);25 }26 27 int update(int p, int l, int r, int rt)28 ... 阅读全文
posted @ 2015-05-15 18:03 Running_Time 阅读(135) 评论(0) 推荐(0)
摘要:题目传送门 1 /* 2 结点存储下面有几个空位 3 每次从根结点往下找找到该插入的位置, 4 同时更新每个节点的值 5 */ 6 #include 7 #define lson l, m, rt > 1;21 build (lson);22 build (... 阅读全文
posted @ 2015-05-15 17:47 Running_Time 阅读(119) 评论(0) 推荐(0)
摘要:题目传送门 1 /* 2 主要利用线段树求区间最值,sum[]代表位置可用空间 3 每次找到最大值的位置 4 功能:查询最靠前能容纳广告的位置 5 */ 6 #include 7 #include 8 #include 9 #define lson l, m, rt >... 阅读全文
posted @ 2015-05-15 17:36 Running_Time 阅读(118) 评论(0) 推荐(0)

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 32 下一页