上一页 1 ··· 6 7 8 9 10 11 12 13 下一页
摘要: http://www.jianshu.com/p/10ed9ae02775 阅读全文
posted @ 2017-10-15 00:24 ninding 阅读(169) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/woaichimahua/article/details/54427528 阅读全文
posted @ 2017-10-15 00:22 ninding 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目: 划分数 有n个无区别的物品,将他们划分成不超过m组,求出划分方法数模M的余数。 限制条件: 1 <= m <= n <= 1000; 2 <= M <= 10000; 输入: 输入 n,m,M分别代表n个物品、m个组、对M取模。 输出: 输出划分方法数对M取模的余数。 样例输入: 4 3 1 阅读全文
posted @ 2017-10-14 23:02 ninding 阅读(1600) 评论(0) 推荐(0) 编辑
摘要: Fence Repair Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 53106 Accepted: 17508 Description Farmer John wants to repair a small length o 阅读全文
posted @ 2017-10-14 20:54 ninding 阅读(238) 评论(0) 推荐(0) 编辑
摘要: Best Cow Line Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26670 Accepted: 7226 Description FJ is about to take his N (1 ≤ N ≤ 2,000) co 阅读全文
posted @ 2017-10-13 22:56 ninding 阅读(177) 评论(0) 推荐(0) 编辑
摘要: int a[3] = {1,2,3}; a可能形成的集合为{1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,1,2},{3,2,1}。 {2,1,3}的prev是{1,3,2}, next是{2,3,1}。 用法 阅读全文
posted @ 2017-10-13 21:57 ninding 阅读(338) 评论(0) 推荐(0) 编辑
摘要: Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37384 Accepted: 18586 Description Due to recent rains, water has pooled in va 阅读全文
posted @ 2017-10-13 21:32 ninding 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 题目: 1268 和为K的组合 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 1268 和为K的组合 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 1268 和为K的组合 基准时间限制:1 秒 空间限制:131072 KB 阅读全文
posted @ 2017-10-13 21:09 ninding 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 题目: 思路:蚂蚁相碰和不相碰的情况是一样的,相当于交换位置继续走。 代码: 阅读全文
posted @ 2017-10-13 20:33 ninding 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 在命令行下输入: sudo add-apt-repository ppa:a-v-shkop/chromium sudo apt-get update sudo apt-get install chromium-browser 安装完成。 阅读全文
posted @ 2017-10-13 15:01 ninding 阅读(838) 评论(0) 推荐(0) 编辑
摘要: 题目: 思路: a[i]:第i种硬币的面额。 dp[j]表示有前i种硬币,要求面额为j时,有多少种方案。 dp[j] = (dp[j] + dp[j-a[i]])%mod; 不装的情况+装的情况 代码: 阅读全文
posted @ 2017-10-11 00:47 ninding 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 题目: 这题很简单,找规律即可。 考虑两次进位: 1.a*b时的进位。 2.aa*b时加法时进位。 代码: 阅读全文
posted @ 2017-10-10 17:45 ninding 阅读(272) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; typedef long long ll; struct Node{ int key; Node *next,*prev; }; Node *nil; void init(){ nil = (Node *) malloc(sizeof(Node)); nil->next = nil; ... 阅读全文
posted @ 2017-10-08 17:20 ninding 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 代码: 题意,第一个数为0,相邻的数相差0或者1,有一些点有限制,不大于给定值,求这组数中可能的最大的那个数。 这题我们看一个例子:第5个数的限制为2 1 2 3 4 5 6 7 8 9 0 1 2 3 2 第一个数一定是0,那么我们可以看出其中最大的数为3。 第二个例子:第6个数的限制为2 1 2 阅读全文
posted @ 2017-10-08 16:43 ninding 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 题目: 总结大佬们的思路: 思路1:所有数两两求和,存入map中,每次判断有没有相反数被标记过。 思路2:对所有数排序,排完所有数两两求和,结果正好是排好序的。然后扫一遍,二分查找看之前有没有相反数存在。 思路1时间复杂度O(n^2),空间复杂度O(n^2) 思路2时间复杂度O(n^2log(n)) 阅读全文
posted @ 2017-10-07 01:19 ninding 阅读(281) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 下一页