“初始化 定义 赋值” 之间的联系与区别
本来很早之前就想写个blog,说说这三个家伙的区别和联系,三者之间各种联系,很难比较清楚的讲明白,感觉当时好像分析思路还不够“完整”。今天遇到别人抛出来的一个问题。根本的问题是和初始化和赋值有关系,于是留下这个blog。
#include
struct _ANIBMP
{
int FirstNu...
分类:
其他好文 时间:
2014-07-22 23:04:54
阅读次数:
384
题目链接:uva 10773 - Back to Intermediate Math
题目大意:有一天河,宽d,水流速度v,船速u,问说垂直过河和最快过河的时间差,如果不能过河输出“can't determine”。
解题思路:将u的速度分解成水平方向和竖直方向的两个速度,使水平方向速度恰好为v,船即可垂直过河,速度为竖直方向速度。
#include
#includ...
分类:
其他好文 时间:
2014-07-22 23:04:12
阅读次数:
235
Ultra-QuickSort
Time Limit: 7000MS
Memory Limit: 65536K
Total Submissions: 38588
Accepted: 13903
Description
In this problem, you have to analyze a particular sorti...
分类:
其他好文 时间:
2014-07-22 23:02:34
阅读次数:
303
这道题在前两个的基础上做稍微改进就可以。下面是AC代码: 1 /** 2 * Design an
algorithm to find the maximum profit. You may complete at most two transactions.
3 * @pa...
分类:
其他好文 时间:
2014-07-22 23:01:13
阅读次数:
251
以前做项目,不注意记录调试过程中遇到的问题,以后应该注意这一点。今天抽空总结一下PCI-CAN卡驱动与数据通信调试过程中遇到的问题,方便以后回忆和思考。 1.
中断服务之字节流报文组包状态机 这是一个典型的适合采用状态机来思考和处理数据的场合。报文一般分为这几个字段:报文头,长度,命令,数据,校验和...
分类:
其他好文 时间:
2014-07-22 22:59:36
阅读次数:
319
题目: Given a string S, find the longest palindromic
substring in S. You may assume that the maximum length of S is 1000, and there
exists one unique lo...
分类:
其他好文 时间:
2014-05-01 20:07:13
阅读次数:
429
先用bfs预处理出层次图,然后在层次图上用dfs找增广路径,理论复杂度O(n*n*m)const
int INF=0xfffffff ;struct node{ int s,t,cap,nxt ;}e[200005] ;int
m,n,head[10005],level[10005],cnt ...
分类:
其他好文 时间:
2014-05-01 20:05:16
阅读次数:
379
Determine whether an integer is a palindrome.
Do this without extra space.Some hints:Could negative integers be palindromes?
(ie, -1)If you are thinki...
分类:
其他好文 时间:
2014-05-01 19:48:19
阅读次数:
344
递归:就是出现这种情况的代码: (或者说是用到了栈)解答树角度:在dfs遍历一棵解答树
优点:结构简洁缺点:效率低,可能栈溢出递归的一般结构:1 void f() {2 if(符合边界条件) {3 ///////4 return;5 }6 7
...
分类:
其他好文 时间:
2014-05-01 19:20:17
阅读次数:
343
图的连通分量,关节点和桥
====
对于有向图,我们称其一个子图是强连通分量,是指任意两点u,v, 都有两条路径u到v和v到u。
对于连通无向图,我门称其一个子图是双连通分量,是指任意两点u,v,存在一个圈包含u,v。与无向图相关联的还有关节点x,是指去掉x,图不连通;桥(u,v)是指去掉这条边,图不连通。
求解算法的要义在于首先要理解:
树边-前向边-后向边-交叉边
"Conside...
分类:
编程语言 时间:
2014-04-30 22:37:40
阅读次数:
448