求最少去掉几个公交站使得从s到t的最短路径大于k。迭代加深搜索。#include #include #include using namespace std;#define maxn 60#define maxm 50000int n,m,K,cnt,up;int head[maxn],pre[ma...
分类:
其他好文 时间:
2014-07-14 09:29:57
阅读次数:
221
OSPF排错报告故障点一:PPP链路故障故障现象:R2和R4之间的PPP链路一会down一会UP故障分析:1) ppp 认证类型是否一致2) ppp chap认证用户是否配置正确3) pppp chap认证密码是否配置正确4) 进行chap认证的用户是否包含ppp的服务类型故障解决:1) 在RT2 ...
分类:
其他好文 时间:
2014-07-13 19:33:28
阅读次数:
284
点击打开链接
题意:有n层楼层,现在在每一层有两个按钮,分别为up和down,按动按钮时,可以向上或向下跳动num[ i ]层;问能否以最少的次数从A到B层,不能输出-1;
解析:构图,将从i层到按动按钮后跳转的楼层,看作连通状态,赋值为1,这样就转换成单源最短路问题;
#include
#include
#include
using namespace std;
const int m...
分类:
其他好文 时间:
2014-07-13 18:37:00
阅读次数:
231
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
/**
* Definition for singly-linked list.
* class ListNode {
* int val;
* ...
分类:
其他好文 时间:
2014-07-13 16:32:04
阅读次数:
152
DOWN操作:linux内核中,对信号量的DOWN操作有如下几种:
void down(struct semaphore *sem); //不可中断
int down_interruptible(struct semaphore *sem);//可中断
int down_killable(struct semaphore *sem);//睡眠的进程可以因为受到致命信号而被唤醒,中断获取信号量...
分类:
其他好文 时间:
2014-07-13 16:21:36
阅读次数:
501
1. 固定一个MAC地址,特别是在使用多个虚拟机的时候
linux环境下:
用root身份登录,在/etc/rc.d/rc.local里加上这三句
ifconfig eth0 down
ifconfig eth0 hw ether 00:0C:18:EF:FF:ED
ifconfig eth0 up
这样重新reboot后就不怕MAC复原了。
2. ifconfig命令(转...
分类:
系统相关 时间:
2014-07-13 16:14:11
阅读次数:
322
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2014-07-13 13:58:01
阅读次数:
184
SharePoint 2010 使得往你的网站添加对话框内容变得出乎意料的简单。内置的功能允许你从站点任何地方抽取内容,然后显示在模态对话框中,出现在页面的前端。...
分类:
其他好文 时间:
2014-07-12 22:09:41
阅读次数:
258
Just like normal variables, pointers can be declared constant. There are two different ways that pointers and const can be intermixed, and they are very easy to mix up.
To declare a const pointer, ...
分类:
其他好文 时间:
2014-07-12 21:20:23
阅读次数:
165
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2014-07-12 19:06:27
阅读次数:
204