
ACM题解专栏
文章平均质量分 61
主要涉及博主自己做ACM时所学的一些东西,主要涉及图论,动态规划,贪心,搜索等算法。梦想有多大,你就有多勇敢!
shengweisong
只有行动,才能解除所有的不安
展开
-
nyoj 628 小媛在努力 【搜索】
水师——————原创 2014-06-10 08:53:56 · 1416 阅读 · 0 评论 -
poj 2236 Wireless Network 【并查集】
Wireless NetworkTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 16832 Accepted: 7068DescriptionAn earthquake takes place in Southeast Asia. The ACM (原创 2014-11-18 01:03:49 · 1358 阅读 · 0 评论 -
蓝桥杯 历届试题 兰顿蚂蚁 【模拟】
历届试题 兰顿蚂蚁 时间限制:1.0s 内存限制:256.0MB 问题描述 兰顿蚂蚁,是于1986年,由克里斯·兰顿提出来的,属于细胞自动机的一种。 平面上的正方形格子被填上黑色或白色。在其中一格正方形内有一只“蚂蚁”。 蚂蚁的头部朝向为:上下左右其中一方。 蚂蚁的移动规则十分简单: 若蚂蚁在黑格,右转原创 2015-01-18 20:31:13 · 1810 阅读 · 0 评论 -
hdoj 1598 find the most comfortable road 【并查集】+【暴力枚举】
find the most comfortable roadTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4022 Accepted Submission(s): 1732Problem Descript原创 2014-11-13 00:06:03 · 1545 阅读 · 0 评论 -
poj 1328 Radar Installation 【贪心】【区间选点问题】
Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 54798 Accepted: 12352DescriptionAssume the coasting is an infinite straight line. La原创 2014-11-18 01:01:07 · 1488 阅读 · 2 评论 -
nyoj 420 p次方求和 【快速幂】
题意。。。策略:rt代码:#include #include #define temp 10003int ans(int n, int p){ int res = 1; n %= temp; while(p){ if(p&1) res = (n*res)%temp; n = (n*n)%temp; p /= 2; } return res;}int ma原创 2014-09-13 00:00:05 · 1426 阅读 · 0 评论 -
hdoj 3068 最长回文 【manacher算法】
题意。。。用传统的方法来做的话,要超时(就是要进行奇偶判断)。manacher算法,百度一下讲解好的有很多。纪念粘代码:#include #include #include using namespace std;#define M 110010char a[M], b[M<<1];int p[M<<1];int main(){ while(~scanf原创 2014-09-11 00:06:12 · 1319 阅读 · 0 评论 -
poj 3641 Pseudoprime numbers 【快速幂】
Pseudoprime numbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6645 Accepted: 2697DescriptionFermat's theorem states that for any prime number p a原创 2014-11-18 00:11:13 · 2008 阅读 · 0 评论 -
nyoj 12 喷水装置(二)【贪心】+【区间完全覆盖覆盖】
题意:。。。这道题就是区间问题三种中的区间完全覆盖问题,不懂的可以看我上一篇也是区间完全覆盖。直接上代码:#include #include #include using std::sort;struct node{ double le, ri;}s[1005];int cmp(node a, node b){ return a.le < b.le;}int ma原创 2014-08-19 23:33:14 · 1737 阅读 · 0 评论 -
hdoj 1116 Play on Words 【并查集】+【欧拉路】
Play on WordsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5622 Accepted Submission(s): 1850Problem DescriptionSome of the原创 2014-11-14 00:30:52 · 2011 阅读 · 0 评论 -
ACM end
大学两年acm给了我一直前进的动力,但心已倦,see you ACM!!!原创 2015-08-09 18:21:05 · 840 阅读 · 0 评论