Bubu's bookshelf is in a mess! Help him!There arenbooks on his bookshelf. We define the mess value to be the number of segments ofconsecutive equal-he...
分类:
其他好文 时间:
2014-07-19 20:36:17
阅读次数:
248
枚举两点,然后同步BFS,看代码吧,很容易懂的。代码:#include #include #include #include #include #include #include #define Mod 1000000007using namespace std;struct Point{ i...
分类:
其他好文 时间:
2014-07-19 20:21:38
阅读次数:
245
lib/pathalloc.c#include "apue.h"#include #include #ifdef PATH_MAXstatic int pathmax = PATH_MAX;#elsestatic int pathmax = 0;#endif#define SUSV3 200112L...
分类:
其他好文 时间:
2014-07-19 19:34:54
阅读次数:
280
有向图是否具有欧拉通路或回路的判定:欧拉通路:图连通;除2个端点外其余节点入度=出度;1个端点入度比出度大1;一个端点入度比出度小1 或 所有节点入度等于出度欧拉回路:图连通;所有节点入度等于出度#include#include#define MAX 27int in[MAX],out[MAX];i...
分类:
其他好文 时间:
2014-07-19 19:31:05
阅读次数:
178
mycat/mycat.c#include "apue.h"#define BUFFSIZE 4096intmain(void){ int n; char buf[BUFFSIZE]; while ((n = read(STDIN_FILENO, buf, BUFFSIZE)) > 0) if .....
分类:
其他好文 时间:
2014-07-19 00:00:58
阅读次数:
216
1506题意:给你连续的直方图(底边边长为1),求连续的矩阵面积。
对每个直方图,分别向左向右进行扩展。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define...
分类:
其他好文 时间:
2014-07-18 23:12:40
阅读次数:
290
52控制DAC0832芯片输出电流,让发光二极管D12由灭均匀变到最亮,再有亮变灭,在最亮和最灭的时候蜂鸣器发出报警声,完成整个周期的时间是控制在5s左右。
#include
#define uchar unsigned char
#define uint unsigned int
sbit dula=P2^6;
sbit wela=P2^7;
sbit dawr=...
分类:
其他好文 时间:
2014-07-18 23:02:11
阅读次数:
284
开始时数码管不显示,顺序按下矩阵键盘后,在数码管上依次显示0~F,6个数码管同时静态显示。
数码管和矩阵键盘
首先关闭所有的数码管的段选不让数码管显示任何数字,然后位选中所有的数码管,接下来只需要选中所有的数码管,以后的操作的只需要送段选数据就行了,接着进入while()大循环不停的扫描键盘是否有被按下
#include
#define uchar unsigned char
#de...
分类:
其他好文 时间:
2014-07-18 21:29:08
阅读次数:
269
在上位机上用串口调试助手发送一个字符X,单片机收到字符后返回给上位机“I get X”,串口波特率设为9600bps。
#include
#define uchar unsigned char
unsigned char flag,a,i;
uchar code table[]="I get";
void init()
{
TMOD=0x20; //设定T1定时器的工作模式2
...
分类:
其他好文 时间:
2014-07-18 21:23:22
阅读次数:
193
/** \brief poj 1502--Dijkstra
*
* \ date 2014/7/15
* \ state AC
* *
*/
#include
#include
#include
#include
using namespace std;
#define inf 0x03f3f3f3f
const int MAXN=101;
int n;
int co...
分类:
其他好文 时间:
2014-07-18 21:22:31
阅读次数:
192