会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
acm_roll
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
26
下一页
2014年9月19日
基数排序
摘要: = = 现在才会写,感觉有点怂就是一位一位的比较,对于每一位,使用计数排序,然后排序就好了,而且显然这是一种稳定排序算法。#include #include using namespace std;const int maxn = 1005;int num[maxn], n, bid[maxn], ...
阅读全文
posted @ 2014-09-19 14:41 acm_roll
阅读(241)
评论(0)
推荐(0)
2014年9月16日
POJ 1743 Musical Theme Hash + 二分
摘要: 原本是《后缀数组——处理字符串的有力工具》论文中的第一道例题,发现自己智商不够,一个下午没有看懂后缀数组= =,就用hash写了#include #include #include #include using namespace std;typedef long long LL;const int...
阅读全文
posted @ 2014-09-16 22:27 acm_roll
阅读(148)
评论(0)
推荐(0)
2014年9月15日
POJ 1379 Run Away 模拟退火
摘要: 一开始写了一发很快的,发现一会能过一会不能,貌似有点悬,毕竟是随机算法。后来重写了一发迭代5遍的,基本上把把AC了= =模拟退火果然是一种不是很靠谱的算法。#include #include #include #include #include #include using namespace st...
阅读全文
posted @ 2014-09-15 22:04 acm_roll
阅读(344)
评论(0)
推荐(0)
HDU 5017 Ellipsoid 模拟退火
摘要: 网赛的时候感觉可以用模拟退火搞但是不会写,今天学了一下感觉模拟退火本身也不是很难= =#include #include #include #include using namespace std;const double eps = 1e-8;const double r = 0.99; //降温...
阅读全文
posted @ 2014-09-15 21:04 acm_roll
阅读(1984)
评论(3)
推荐(2)
HDU 3480 Division DP + 四边形优化
摘要: 水题,证明有单调性之后直接照着拍就好#include #include #include #include using namespace std;#define sq(x) ((x)*(x))const int maxn = 10005;const int maxm = 5005;int f[ma...
阅读全文
posted @ 2014-09-15 20:25 acm_roll
阅读(183)
评论(0)
推荐(0)
hdu 2829 Lawrence DP 四边形优化
摘要: 这里的w显然满足速递变形不等式的规则,所以用四边形加速即可#include #include #include using namespace std;const int maxn = 1005;const int maxm = 1005;int w[maxn][maxn], sum[maxn], ...
阅读全文
posted @ 2014-09-15 19:32 acm_roll
阅读(142)
评论(0)
推荐(0)
Python 学习小结
摘要: 开学没什么事情,抽出了一点时间学了一下python的最基本的东西,版本是python 2.7.8 通过内置变量__name__可以知道自己现在是处于执行状态还是作为一个模块引入的。 使用help()函数可以查看模块的帮助文档,python会根据注释自动生成帮助文档 使用dir(__builtins__)可以查看所有内置函数,当然也可以用来查看别的模块中的内容,当然查看之前要先import...
阅读全文
posted @ 2014-09-15 16:49 acm_roll
阅读(182)
评论(0)
推荐(0)
2014年9月14日
POJ 1160 Post Office 经典DP + 四边形加速
摘要: 第一次写四边形不等式的题,现在的理解就是用各种东东缩小了k的范围,从而使复杂度降低到n^2需要满足的条件是对于i#include #include #include #include #include #include #include #include #include #include usin...
阅读全文
posted @ 2014-09-14 11:23 acm_roll
阅读(158)
评论(0)
推荐(0)
2014年9月12日
UVA 1625 Color Length DP
摘要: 单独把每个字母第一次出现和最后一次出现拿出来处理一下就好#include #include #include #include #include #include #include #include #include #include #include #include #include #incl...
阅读全文
posted @ 2014-09-12 16:50 acm_roll
阅读(187)
评论(0)
推荐(0)
2014年9月11日
UVA 11400 Lighting System Design DP
摘要: 最优情况不可能跨过一种灯泡,为什么? 因为如果A换成C是划算的那么如果A换成B是不划算的那么可以将A和B都换成C,肯定是划算的= =然后就是简单DP了。#include #include #include #include #include #include #include #include #i...
阅读全文
posted @ 2014-09-11 22:18 acm_roll
阅读(173)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
26
下一页
公告