上一页 1 2 3 4 5 6 7 ··· 24 下一页
摘要: #include #include #include #include #include using namespace std; const int N=1e4+5; int n,m1,m2; int s[N],prime[N],maxn,t=2,c,ans=0x7fffffff,l; int main() { scanf("%d%d%d",&n,&m1,&m2); f... 阅读全文
posted @ 2018-09-12 11:33 whymhe 阅读(259) 评论(0) 推荐(0) 编辑
摘要: //Pro: P3375 【模板】KMP字符串匹配 #include #include #include #include #include using namespace std; const int N=1e6+5; char a[N],b[N]; int nxt[N]; int main() { scanf("%s",a+1); scanf("%s",b+1); ... 阅读全文
posted @ 2018-09-12 11:32 whymhe 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目描述 根据一些书上的记载,上帝的一次失败的创世经历是这样的: 第一天, 上帝创造了一个世界的基本元素,称做“元”。 第二天, 上帝创造了一个新的元素,称作“α”。“α”被定义为“元”构成的集合。容易发现,一共有两种不同的“α”。 第三天, 上帝又创造了一个新的元素,称作“β”。“β”被定义为“α 阅读全文
posted @ 2018-09-12 11:31 whymhe 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题目背景 感谢hzwer的点分治互测。 题目描述 给定一棵有n个点的树 询问树上距离为k的点对是否存在。 输入输出格式 输入格式: n,m 接下来n-1条边a,b,c描述a到b有一条长度为c的路径 接下来m行每行询问一个K 输出格式: 对于每个K每行输出一个答案,存在输出“AYE”,否则输出”NAY 阅读全文
posted @ 2018-09-12 11:30 whymhe 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 题目描述 小Y来到了一个新的城市旅行。她发现了这个城市的布局是网格状的,也就是有n条从东到西的道路和m条从南到北的道路,这些道路两两相交形成n*m个路口 (i,j)(1<=i<=n,1<=j<=m)。 她发现不同的道路路况不同,所以通过不同的路口需要不同的时间。通过调查发现,从路口(i,j)到路口( 阅读全文
posted @ 2018-09-12 11:29 whymhe 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给你一棵TREE,以及这棵树上边的距离.问有多少对点它们两者间的距离小于等于K 输入输出格式 输入格式: N(n<=40000) 接下来n-1行边描述管道,按照题目中写的输入 接下来是k 输出格式: 一行,有多少对点之间的距离小于等于k 输入输出样例 输入样例#1: 复制 7 1 6 13 阅读全文
posted @ 2018-09-12 11:28 whymhe 阅读(187) 评论(0) 推荐(0) 编辑
摘要: //Pro: P2375 [NOI2014]动物园 //题意:求1 #include #include #include #include using namespace std; const int N=1e6+5; const int mod=1e9+7; int n,len; int nxt[N],num[N]; char s[N]; long long ans; int main... 阅读全文
posted @ 2018-09-12 11:27 whymhe 阅读(212) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std; inline int read() { char c=getchar();int num=0; for(;!isdigit(c);c=getchar()); for(;isdigit(c);c=getchar()) num=... 阅读全文
posted @ 2018-09-12 11:26 whymhe 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Description 轮状病毒有很多变种,所有轮状病毒的变种都是从一个轮状基产生的。一个N轮状基由圆环上N个不同的基原子和圆心处一个核原子构成的,2个原子之间的边表示这2个原子之间的信息通道。如下图所示 N轮状病毒的产生规律是在一个N轮状基中删去若干条边,使得各原子之间有唯一的信息通道,例如共有1 阅读全文
posted @ 2018-09-12 11:25 whymhe 阅读(123) 评论(0) 推荐(0) 编辑
摘要: /*一开始以为是个贪心 发现自己太naive了 将每个技术工人拆成n个点,一共拆n*m个,第i个表示倒数第i次修车。 让每辆车向拆出来的点连边,费用为tmp[i][j]*k,i是技工,j是车,k是拆出来的第几个点, 这样设置费用的原因是j是i倒数第k个修的,那么i修的后k个车都要等倒数第k个车。 然后跑最小费用最大流就可以了 */ #include #include #include #i... 阅读全文
posted @ 2018-09-12 11:22 whymhe 阅读(96) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 24 下一页