對酒當歌,人生幾何? 譬如朝露,去日苦多

数据结构之struct和typedef struct

1.c语言下二者的意义typedef struct用法#include <stdio.h> typedef struct node { int x; int y; }stu; //struct node和stu都代表数据类型 //所以有两种定义变量的形式,如下 //也可以不写node,但是只能用stu定义了 int main() { struct node b; stu a; a.x=1; a.y=2; b.x=3; b.y=4; printf("%d %d\n",a.x,a.y); printf("%d %d\n",b.x,b.y); return 0; } struct 用法#include <stdio.h> struct node { int x; int y; }; //struct node代表数据类型 //所以只有一种定义方式 int main() { struct no...

vscode配置c++

1.装一个c++插件,微软的。2.配置launch.json(直接复制粘贴吧){ "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceRoot}/a.out", "args": [], "stopAtEntry": false, "cwd": "${workspaceRoot}", "environment": [], "externalConsole": true, "MIMode": "gdb", "setupCommands": [ ...

二分图匹配

kuangbin专题分类一. 二分匹配先看一下理论理解一下:http://www.renfei.org/blog/bipartite-matching.html然后趣学匈牙利算法:一遍就看懂A,B,C,D,E,G1.交叉染色判断二分图。2.二分图最小点覆盖(König定理证明)(好像只能无向,对吧?)I,感谢Matrix   感谢:http://blog.csdn.net/kootain/article/details/6692582?utm_source=jiancool其实就是二分图最大匹配,要换个角度思考。二分图最大匹配匹配到的点为集合M。x点属于左集合,y点属于右集合,且x点和y点不属于M,那么x,y点一定没有路相连,因为它们不属于集合M。所以除集合M的点外,其他点与之相连的边一定属于M,M中的点是二分图最大匹配,所以就相等,但是有向要改为无向进行二分图最大匹配。3.无向图二分图最小路径覆盖,H,无向二分图的最小路径覆盖 = 顶点数 – 最大二分匹配数/2一开始我想时是这样的样例,有7个点,经过匹配1和5,2和4,3和6,7单出来。所以我以为是(二分图最大匹配+1)/2,...

VIM配置

学长的:http://www.cnblogs.com/coded-ream/p/7207919.html.vimrc如果为了使用hjkl来控制上下左右,最好把176,177和179行关掉。 " This line should not be removed as it ensures that various options are " properly set to work with the Vim-related packages available in Debian. " debian.vim " Uncomment the next line to make Vim more Vi-compatible " NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous " options, so any other options should be set AFTER setting 'compatible'. ...

更新源

听说这个很快进入root命令命令:vim /etc/apt/sources.list