上一页 1 2 3 4 5 6 7 8 9 ··· 29 下一页
摘要: nyoj 63 小猴子下落 题目链接: [http://acm.nyist.net/JudgeOnline/problem.php?pid=63][97919ed7] 思路: 不需要用指针创建二叉树,也不需要用数组来模拟二叉树,空间上更浪费 这里只需要知道当最后一只猴子走的时候,开关是什么状态即可 阅读全文
posted @ 2017-11-28 11:04 lemonsbiscuit 阅读(200) 评论(0) 推荐(0) 编辑
摘要: nyoj 2 括号配对问题 题目链接: [http://acm.nyist.net/JudgeOnline/problem.php?pid=2][53ddd712] 思路: 栈:'(' '['入栈,遇到 ']' ')'出栈 出现RE错误是因为如果栈顶元素需要出栈的时候没有先判空 代码: c++ in 阅读全文
posted @ 2017-11-27 23:46 lemonsbiscuit 阅读(173) 评论(0) 推荐(0) 编辑
摘要: codeforces 895B XK Segments 题目大意: 寻找符合要求的$(i,j)$对,有:$$a_i \le a_j $$ 同时存在$k$,且$k$能够被$x$整除,$k$满足:$$a_i \le k \le a_j$$ 思路: 整体数组排序,对于当前$a_i$寻找符合条件的$a_j$ 阅读全文
posted @ 2017-11-27 14:14 lemonsbiscuit 阅读(485) 评论(2) 推荐(1) 编辑
摘要: codeforces 895A Pizza Separation 题目大意: 分成两大部分,使得这两部分的差值最小(注意是圆形,首尾相连) 思路: 分割出来的部分是连续的,开二倍枚举。 注意不要看成01背包,一定多读题 代码: c++ include using namespace std; int 阅读全文
posted @ 2017-11-27 02:50 lemonsbiscuit 阅读(425) 评论(0) 推荐(0) 编辑
摘要: codeforces 893D Credit Card 题目大意: 有一张信用卡可以使用,每天白天都可以去给卡充钱。到了晚上,进入银行对卡的操作时间,操作有三种: 1.$a_i 0$ 银行会给卡充入$a_i$元 2.$a_i d$,那么说明通过充钱调节,将最大值回到$d$。最后输出去银行的次数。 代 阅读全文
posted @ 2017-11-26 23:05 lemonsbiscuit 阅读(422) 评论(0) 推荐(0) 编辑
摘要: hdoj 4325 Flowers 题目链接: [http://acm.hdu.edu.cn/showproblem.php?pid=4325][f9fc1a32] 思路: 直接线段树,按照花的开放区间的大小建树,要注意虽然花的周期数据可能会达到1e9,这样的话线段树开四倍时不可能的。但是我们可以看 阅读全文
posted @ 2017-11-26 16:15 lemonsbiscuit 阅读(266) 评论(0) 推荐(0) 编辑
摘要: poj 2528 Mayor's posters 题目链接: [http://poj.org/problem?id=2528][f011568f] 思路: 线段树+离散化技巧(这里的离散化需要注意一下啊,题目数据弱看不出来) 假设给出: 1~10 1~4 7 10 最后可以看见三张海报 如果离散化的 阅读全文
posted @ 2017-11-26 14:33 lemonsbiscuit 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 893C Rumor 思路: 前向星+DFS 代码: c++ include using namespace std; define _for(i,a,b) for(int i=(a); i n m; _rep(i,1,n) cin w[i]; _rep(i,1,m) { cin u v; add( 阅读全文
posted @ 2017-11-26 00:05 lemonsbiscuit 阅读(322) 评论(2) 推荐(0) 编辑
摘要: 893B Beautiful Divisors 思路: 打表 代码: 阅读全文
posted @ 2017-11-26 00:03 lemonsbiscuit 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 893A Chess For Three 思路: 直接模拟即可,第一盘永远是A与B开始 代码: c++ include using namespace std; define _for(i,a,b) for(int i=(a); i n; _rep(i,1,3) a[i]=i; _rep(i,1,n 阅读全文
posted @ 2017-11-26 00:01 lemonsbiscuit 阅读(191) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 29 下一页