摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1406 Problem Description 完数的定义:如果一个大于1的正整数的所有因子之和等于它的本身,则称这个数是完数,比如6,28都是完数:6=1+2+3;28=1+2+4+7+14。... 阅读全文
posted @ 2015-08-20 23:07 Zeroinger 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1286 Problem Description 新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯... 阅读全文
posted @ 2015-08-20 22:35 Zeroinger 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 单身狗在今天做这题也是。。。。哎,不提也罢! 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1215 打表记录,话不多说,直接上代码,但是所有的数都肯定有1这个因数,所以ans数组初始化为1。 代码如下: #include#include#incl... 阅读全文
posted @ 2015-08-20 17:47 Zeroinger 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/467/C 题目大意:求k个不覆盖的最大连续区间和,每个区间长度为m。 影响决策的因素有k和区间和,所以dp[i][j]的含义就显而易见了,表示在以第i个数的位置选择了j个子序列的最大值。 所以状态方程... 阅读全文
posted @ 2015-08-18 20:02 Zeroinger 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 奇数个的那个数 给定些数字,这些数中只有一个数出现了奇数次,找出这个数。 Input 每组数据第一行n表示数字个数,1 using namespace std;int n,ans=0;int main(){ while(scanf("%d",&n)!=EOF) { in... 阅读全文
posted @ 2015-08-18 15:07 Zeroinger 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Description It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring proces... 阅读全文
posted @ 2015-08-17 01:08 Zeroinger 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Description Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a rive... 阅读全文
posted @ 2015-08-16 20:48 Zeroinger 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Description Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated an... 阅读全文
posted @ 2015-08-16 16:28 Zeroinger 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Description Farmer John has built a new long barn, with N (2 #include#includeusing namespace std;const int INF=1000000000;const int maxn=100005;int... 阅读全文
posted @ 2015-08-16 00:40 Zeroinger 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Description Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promis... 阅读全文
posted @ 2015-08-15 18:28 Zeroinger 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 线段树 转载于http://blog.csdn.net/metalseed/article/details/8039326 一:线段树基本概念 1:概述 线段树,类似区间树,是一个完全二叉树,它在各个节点保存一条线段(数组中的一段子数组),主要用于高效解决连续区间的动态查询问... 阅读全文
posted @ 2015-08-11 17:28 Zeroinger 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题意:给定N个点和M条边,点编号是1到N。现在要从2到N-1中选择一个删除,同时跟选择的点连接的边也就消失,然后使得点1到N的最短路径的长度最大。如果点1和点N不连通,则输出“Inf"。 按照题意,N最多30,而M可以达到1000,应该是存在重边的。 可以设定邻接矩阵f,不存在的边设为inf... 阅读全文
posted @ 2015-08-04 19:58 Zeroinger 阅读(105) 评论(0) 推荐(0) 编辑
摘要: XYZZY Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1701 Accepted Submission(s): 41... 阅读全文
posted @ 2015-08-04 17:03 Zeroinger 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目大意: John的农场里N块地,M条路连接两块地,W个虫洞,虫洞是一条单向路,会在你离开之前把你传送到目的地,就是当你过去的时候时间会倒退Ts。我们的任务是知道会不会在从某块地出发后又回来,看到了离开之前的自己。简化下,就是看图中有没有负权环。有的话就是可以,没有的话就是不可以了。 注意,路... 阅读全文
posted @ 2015-08-04 15:12 Zeroinger 阅读(82) 评论(0) 推荐(0) 编辑
摘要: Waiting:你的程序刚刚提交,正在等待OJ评测你的程序。 Compiling:OJ正在编译你的程序。 Accepted:OK!你的程序是正确的 ^_^。 Wrong Answer:你的程序运行的结果和正确结果不同。状态页面CASE那一览显示的是你的程序在第几个样例上出错的。 ... 阅读全文
posted @ 2015-08-04 15:06 Zeroinger 阅读(141) 评论(0) 推荐(0) 编辑
无觅关联推荐,快速提升流量