Sweety

Practice makes perfect

导航

2016年5月11日

摘要: Weighted Median 简单排序求和 不过这里有个处理0.5这样的数小技巧,先乘2,之后按照整数操作就行了。 #include #include #include #include #include #include #include #include ... 阅读全文

posted @ 2016-05-11 22:42 蓝空 阅读(172) 评论(0) 推荐(0) 编辑

摘要: Hearthstone II n场比赛,m个场地,m #include #include using namespace std; const int MOD=1e9+7; int main(){ int n,m; long long dp[10... 阅读全文

posted @ 2016-05-11 22:41 蓝空 阅读(128) 评论(0) 推荐(0) 编辑

摘要: Full Binary Tree 在满二叉树中求两个节点的最近距离 #include #include #include #include #include #include #include #include #include #include #include #i... 阅读全文

posted @ 2016-05-11 22:36 蓝空 阅读(117) 评论(0) 推荐(0) 编辑

摘要: Factorial 水题,求阶乘 #include #include #include #include #include #include #include #include #include #include #include #include #include ... 阅读全文

posted @ 2016-05-11 22:35 蓝空 阅读(116) 评论(0) 推荐(0) 编辑

摘要: Devour Magic n个单位,每个单位每秒增加1法力,在某些时间取走一些区间的法力值(取走之后该区间所有单位的法力变为0),求取得的所有法力值。 就是在原来的基础上增加了清零的操作,不过这个清零(实际代码中也可以置为任意值)的操作通过flag标志和一个sset变量来保存下要置的数,... 阅读全文

posted @ 2016-05-11 22:34 蓝空 阅读(171) 评论(0) 推荐(0) 编辑

摘要: Colorful Cupcakes 给出ABC三种颜色的个数,求相邻颜色不相同,首尾颜色不相同的串的个数。 思路: 开始的时候感觉就是个搜索,但是一想简单搜索肯定超时,dp的话也没找出递推公式,竟让把记忆化搜索给忘了,悲哀。。。 dp[i][a][b][k]表示前i个位置A有a个B有b... 阅读全文

posted @ 2016-05-11 22:32 蓝空 阅读(129) 评论(0) 推荐(0) 编辑

摘要: Circle n个数围成一个圈,编号0~n-1,从一个数到其上一个和下一个的数的概率相同(即都是0.5)。给出n,求从0出发到达一个数x所需要的步数的数学期望。 http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&pro... 阅读全文

posted @ 2016-05-11 21:58 蓝空 阅读(148) 评论(0) 推荐(0) 编辑

摘要: angry_birds_again_and_again 给定曲线,给定一个点,求从曲线上某点到x轴上某点直线恰为曲线切线和曲线围成的面积。 水题,求积分做就好了,但是开始还错了,回车竟然判成WR而不是PR,第一题就卡,醉了。。。 #include#include#include#inclu... 阅读全文

posted @ 2016-05-11 21:51 蓝空 阅读(123) 评论(0) 推荐(0) 编辑

摘要: I Hate It Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1754 Description 很多学校流行一种... 阅读全文

posted @ 2016-05-11 21:34 蓝空 阅读(120) 评论(0) 推荐(0) 编辑

摘要: 敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 59337 Accepted Submission(s): 2505... 阅读全文

posted @ 2016-05-11 20:12 蓝空 阅读(139) 评论(0) 推荐(0) 编辑

摘要: Warm up Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Oth... 阅读全文

posted @ 2016-05-11 19:30 蓝空 阅读(125) 评论(0) 推荐(0) 编辑