bfs基础算法水题
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int Max = 1e5+50;
int dist[Max];
vector tree[Max];
int N, D, T;
void init()
{
for(int i = 0; ...
分类:
其他好文 时间:
2014-08-13 14:56:06
阅读次数:
187
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int Max = 100050;
char str[Max][10];
int mark[16][16];
int num[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2...
分类:
其他好文 时间:
2014-08-13 14:55:46
阅读次数:
187
文能深情寻萝莉,武能仗义护人妻[问题描述]Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return ...
分类:
其他好文 时间:
2014-08-13 14:51:56
阅读次数:
228
double 与0比较时有个精度问题,有时需精确到小数点后面几位,例如与>0.0001,而不能与>0比较例如杭电1408盐水的故事ac#includeusing namespace std;int main(){ double vul,d; int sum; int n; while(cin...
分类:
其他好文 时间:
2014-08-13 14:47:36
阅读次数:
184
1.double 与0比较时有个精度问题,有时需精确到小数点后面几位,例如与>0.0001,而不能与>0比较例如杭电1408盐水的故事ac#includeusing namespace std;int main(){ double vul,d; int sum; int n; while(c...
分类:
其他好文 时间:
2014-08-13 14:41:56
阅读次数:
469
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2014-08-13 14:39:26
阅读次数:
153
如何判断两个整型数相乘是否发生溢出求一个判断方法1.------------------#include if (INT_MAX / a < b){ overflow;//cout<<"overflow"<<endl;}else{ c = a*b;}-------------------2.--.....
分类:
其他好文 时间:
2014-08-13 14:38:36
阅读次数:
198
标准库在头中定义了两个模板函数std::min() 和 std::max()。通常用它可以计算某个值对的最小值和最大值。可 惜在 Visual C++ 无法使用它们,因为没有定义这些函数模板。原因是名字min和max与中传统的min/max宏定义有冲突。为了解决 这个问题,Visual C++ 定义...
分类:
编程语言 时间:
2014-08-13 14:27:56
阅读次数:
456
create procedure proc_pay(@maxmoney int,@minmoney int,@paymonth nvarchar(20))as begin select 储值方式,sum(台币) from 储值分析 where uid in (select uid from 储值分析...
分类:
其他好文 时间:
2014-08-13 14:21:26
阅读次数:
140
http://poj.org/problem?id=1195
求矩阵和的时候,下标弄错WA了一次...
求矩形(x1,y1) (x2,y2)的sum
|sum=sum(x2,y2)-sum(x1-1,y2)-sum(x2,y1-1)+sum(x1-1,y1-1)
二维树状数组讲解:http://blog.csdn.net/u011026968/article/details/38532...
分类:
其他好文 时间:
2014-08-13 13:14:06
阅读次数:
260