码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
POJ - 2688 Cleaning Robot
题意:求回收所有垃圾的最短路 思路:先BFS处理两个垃圾的距离,然后DFS记忆化搜索           dp[i][state]表示处理到第i个后状态是state的最短路 #include #include #include #include #include #include using namespace std; const int MAXN = 30; const in...
分类:其他好文   时间:2014-06-19 12:55:30    阅读次数:412
poj-3481-Double Queue-splay树的水题
很水的splay树。 会简单的操作即可。。。 #include #include #include #include #include using namespace std; #define maxn 1100000 #define mem(a,b) memset(a,b,sizeof(a)) #define root10 ch[ch[root][1]][0] #define root1 c...
分类:其他好文   时间:2014-06-19 11:56:59    阅读次数:328
hdu-4288-Coder-线段树
感觉今天的状态有点不好。。。老是在小地方犯错。。。 简单的记录一下就好。 #include #include #include #include #include #include #include #include #pragma comment(linker, "/STACK:1024000000,1024000000") using namespace std; #define maxn...
分类:其他好文   时间:2014-06-19 09:53:25    阅读次数:211
hdu 1757 A Simple Math Problem (矩阵快速幂)
和这一题构造的矩阵的方法相同。 需要注意的是,题目中a0~a9 与矩阵相乘的顺序。 #include #include #include #include #include #define N 10 using namespace std; int mod; typedef long long LL; struct matrix { LL a[10][10]; }...
分类:其他好文   时间:2014-06-16 12:06:07    阅读次数:231
ACM:动态规划,物品无限的背包问题(完全背包问题)
题目:有n种物品,每种物品都有无限件可用。第i种物品的体积是vi,重量是wi。选一些物品装到一个容量为C的背包中,使得背包内物品在总体积不超过C的前提下重量尽量大。 分析,完全背包问题,相对于上上篇文章的硬币问题,只是由DAG上的无权图变成了这里的DAG上的带权图! 输出最后满足体积不超过背包容量的条件下,背包中的最大重量。 代码: #include #include using...
分类:其他好文   时间:2014-06-16 11:59:00    阅读次数:221
LeetCode OJ--Next Permutation *
求一个排列的下一个排列。1,2,3→1,3,23,2,1→1,2,31,1,5→1,5,1#include #include #include using namespace std; class Solution{public: void nextPermutation(vector &nu...
分类:其他好文   时间:2014-06-13 16:41:56    阅读次数:173
LINQ to Object
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Collections; 5 6 namespace Demo1 7 { 8 class Program 9 ...
分类:其他好文   时间:2014-06-13 15:00:27    阅读次数:241
委托与事件
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 委托实现事件1 7 { 8 class Program 9 {1...
分类:其他好文   时间:2014-06-13 14:58:21    阅读次数:208
委托错误点
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 委托练习 7 { 8 class Program 9 {10 ...
分类:其他好文   时间:2014-06-13 14:50:06    阅读次数:244
Leetcode:Linked List Cycle 链表是否存在环
Linked List Cycle:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解题分析:大致思想就是设置两个指针,一个指针每次...
分类:其他好文   时间:2014-06-13 14:41:54    阅读次数:238
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!