码迷,mamicode.com
首页 >  
搜索关键字:AC    ( 12438个结果
AC自动机模板
AC USACO 2015 Feb. Gold T2 Censor一道模板题..... 1 #include 2 #include 3 #include 4 5 #include 6 #include 7 #include 8 #include 9 10 #i...
分类:其他好文   时间:2015-03-10 23:03:46    阅读次数:244
PAT:1054. The Dominant Color (20) AC(抓住最多的特点,处理不同和相同的情况,留下剩余的答案)
#includeint main(){ int m,n,ans,tmp,times=0; scanf("%d%d",&m,&n); for(int i=0 ; i<n ; ++i) //【思维】题目找出现次数最多的一个,找到不同的,次数减少1,减少到0就换成输入的数字。找到相同的数字,次...
分类:其他好文   时间:2015-03-10 23:03:35    阅读次数:171
PAT:1060. Are They Equal (25) AC
#include#include#include#includeusing namespace std;int n;string deal(string s,int &e) //【思维】1:吸收多余0:。2:找到“.”判断与1的大小。3:去除“.”的同时统计10的指数(正负与st...
分类:其他好文   时间:2015-03-10 23:03:07    阅读次数:365
hdu2604---Queuing(AC自动机+矩阵)
Problem Description Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many people lined up at the lunch ti...
分类:其他好文   时间:2015-03-10 21:28:06    阅读次数:154
【秦九韶算法】【字符串哈希】bzoj3751 [NOIP2014]解方程
在模意义下枚举m进行验证,多设置几个模数,而且小一些,利用f(x+p)%p=f(x)%p降低计算次数。UOJ AC,bzoj OLE。#include#include#include#includeusing namespace std;#define MAXV 4951vectorv;typede...
分类:编程语言   时间:2015-03-10 21:19:33    阅读次数:168
PAT:1047. Student List for Course (25) AC
#include#include#include#includeusing namespace std;const int MAX=40010;int n,k; //n个人,k门课char name[MAX][5]; //存n个人的名字vector course[MAX]...
分类:其他好文   时间:2015-03-10 21:05:37    阅读次数:151
hdu 1458 bfs模板化写法
背景:1.编译错误:next和系统命名冲突。2.wa:起点大于楼层的情况未考虑。wawawa了一下午,我把走过就把内容设为-1的方法,改为由flag数组标记是否访问就对了。然后实验,把访问过的标记为-100000,也ac!!!说明题目中ki存在小于0的情况!!!!!存在-1!!!!!与题意不符!!wa了一下午。。。 我的代码:#include #include #include #include...
分类:其他好文   时间:2015-03-10 17:24:36    阅读次数:119
PAT:1004. Counting Leaves (30) AC
#include#includeconst int MAX=510;using namespace std;int n,m,le=0; //节点数,非叶子节点数,最深层叶层数vector child[MAX]; //存储孩子情况int number[MAX]; //...
分类:其他好文   时间:2015-03-10 16:49:01    阅读次数:149
poj 2967 Triangles 排序
题意: 给n跟木棒,问他们是否满足1.其中3根能组成三角形,2.不是任意3根都能组成三角形。 分析: 对于ac,对整个数组排序后判断即可。这题用c++提交会超时,要用g++。 代码: //poj 2967 //sep9 #include #include #include using namespace std; int a[1000024]; int n; char ch; ...
分类:编程语言   时间:2015-03-10 15:37:26    阅读次数:170
PAT:1070. Mooncake (25) AC
#include#include#includeusing namespace std;struct moomcake{ double store; //【cation】这个可能是小数! double sumPrice; double solePrice;}M[1010];bool ...
分类:其他好文   时间:2015-03-10 13:52:53    阅读次数:171
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!