#include#include#include#includeusing namespace std;#define N 5505#define M 55000//注意边和点集的数组大小struct edge{ int to,value,next;}edges[M];int heads[N]...
分类:
其他好文 时间:
2014-07-22 00:20:35
阅读次数:
213
1 在Linux驱动中把无法归类的五花八门的设备定义为混杂设备(用miscdevice结构体表述)。miscdevice共享一个主设备号MISC_MAJOR(即10),但次设备号不同。 所有的miscdevice设备形成了一个链表,对设备访问时内核根据次设备号查找对应的miscdevice设备,然后调用其file_operations结构中注册的文件操作接口进行操作。 在内核中用struct m...
分类:
系统相关 时间:
2014-07-22 00:17:34
阅读次数:
415
题意:给你一个给定的现金数量goal,还有你拥有的n种面值的现金。
接下来就是n种面值的现金你各拥有多少张。要你求出不超过给定goal的能用你手上拥有现金凑成的最大值!
思路:多重背包问题,状态方程dp(i,v)=max(dp(i,j),dp(i-1,v-kci)+kwi);
优化后AC代码:
#include
#include
struct p
{
int n;
...
分类:
其他好文 时间:
2014-07-22 00:09:34
阅读次数:
194
状态压缩,K#include using namespace std;struct pos{ int x,y;}p[15];int f[55][55],r[15];int n,k;int abs(int a){ if(an)continue; for(int j=abs(i)-l;jn)contin...
分类:
其他好文 时间:
2014-07-22 00:08:34
阅读次数:
232
package?main
import?(
????"errors"
????"fmt"
)
type?item?struct?{
????Name?string
}
func?(i?item)?String()?string?{
????return?fmt.Sprintf("item?name:?%v",?i.Name)...
分类:
其他好文 时间:
2014-07-21 23:31:04
阅读次数:
310
/*当对单链表理解后,对双链表就好理解多了,单链表就是只有在结构体或者类中只有一个指针用来存储下一个节点的地址,双链表就是在里面有两个指针,一个用来存储上一个节点的地址,一个用来存储下一个节点的地址。这样的链表就叫双链表。*/
#include
using namespace std;
struct Node
{
int a;
Node *prior,*next; ...
分类:
其他好文 时间:
2014-07-21 16:32:55
阅读次数:
218
import Foundation
println("Hello, World!")
class PeopleClass{
}
struct PeopleStruct{
}
struct Resolution {
var width = 0
var heigth = 0
}
class VideoMode {
var resolution...
分类:
其他好文 时间:
2014-07-21 16:21:54
阅读次数:
208
从sdk3.2.5升级到sdk 7.1中间废弃了很多的方法,还有一些逻辑关系更加严谨了。1,警告:“xoxoxoxo” is deprecated解决办法:查看xoxoxoxo的这个方法的文档,替换掉这个方法即可。2,警告:Declaration of "struct sockaddr" will ...
分类:
其他好文 时间:
2014-07-21 14:39:27
阅读次数:
194
DP矩形镶嵌,打印路径与最长公共子序列相似。 1 #include 2 #include 3 #define doumax(a,b) (a>b?a:b) 4 const int maxn=100; 5 int mat[maxn][maxn],dp[maxn],n; 6 struct node{ 7 ...
分类:
其他好文 时间:
2014-07-21 14:36:28
阅读次数:
387
# include
# include
# include
using namespace std;
struct node
{
int y;
int val;
int num;
friend bool operatorn2.num;//从小到大
return...
分类:
其他好文 时间:
2014-07-21 11:36:44
阅读次数:
203