上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页
摘要: = = 现在才会写,感觉有点怂就是一位一位的比较,对于每一位,使用计数排序,然后排序就好了,而且显然这是一种稳定排序算法。#include #include using namespace std;const int maxn = 1005;int num[maxn], n, bid[maxn], ... 阅读全文
posted @ 2014-09-19 14:41 acm_roll 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 原本是《后缀数组——处理字符串的有力工具》论文中的第一道例题,发现自己智商不够,一个下午没有看懂后缀数组= =,就用hash写了#include #include #include #include using namespace std;typedef long long LL;const int... 阅读全文
posted @ 2014-09-16 22:27 acm_roll 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 一开始写了一发很快的,发现一会能过一会不能,貌似有点悬,毕竟是随机算法。后来重写了一发迭代5遍的,基本上把把AC了= =模拟退火果然是一种不是很靠谱的算法。#include #include #include #include #include #include using namespace st... 阅读全文
posted @ 2014-09-15 22:04 acm_roll 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 网赛的时候感觉可以用模拟退火搞但是不会写,今天学了一下感觉模拟退火本身也不是很难= =#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 阅读(1958) 评论(3) 推荐(2) 编辑
摘要: 水题,证明有单调性之后直接照着拍就好#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 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 这里的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 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 开学没什么事情,抽出了一点时间学了一下python的最基本的东西,版本是python 2.7.8 通过内置变量__name__可以知道自己现在是处于执行状态还是作为一个模块引入的。 使用help()函数可以查看模块的帮助文档,python会根据注释自动生成帮助文档 使用dir(__builtins__)可以查看所有内置函数,当然也可以用来查看别的模块中的内容,当然查看之前要先import... 阅读全文
posted @ 2014-09-15 16:49 acm_roll 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 第一次写四边形不等式的题,现在的理解就是用各种东东缩小了k的范围,从而使复杂度降低到n^2需要满足的条件是对于i#include #include #include #include #include #include #include #include #include #include usin... 阅读全文
posted @ 2014-09-14 11:23 acm_roll 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 单独把每个字母第一次出现和最后一次出现拿出来处理一下就好#include #include #include #include #include #include #include #include #include #include #include #include #include #incl... 阅读全文
posted @ 2014-09-12 16:50 acm_roll 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 最优情况不可能跨过一种灯泡,为什么? 因为如果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 阅读(170) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页