报告见代码。。 1 #include 2 #include 3 #include 4
#include 5 using namespace std; 6 7 const int MAX=105; 8 int
dir[4][2]={1,0,-1,0,0,1,0,-1}; 9...
分类:
其他好文 时间:
2014-06-09 23:04:01
阅读次数:
261
这部分讨论 inference 里面基本的问题,即计算 这类 query,这一般可以认为等价于计算
,因为我们只需要重新 normalize 一下关于 的分布就得到了需要的值,特别是像 MAP 这类 query(一般此时 是 的补集,可以理解成为取
只需要将这里一些 sum 换成 max ...
分类:
其他好文 时间:
2014-06-08 22:53:24
阅读次数:
326
这部分讨论 MAP
估计。从某个角度上来说,我们可以将这个问题转换成为前面讨论过的:这样一来我们只需要将原先的 sum-product 换成 max-sum
即可。话虽这么说,我们还是看看 Koller 同学给大家准备了些什么东西。首先是一些复杂性方面的结论,如给定一个 BN 和常数 ,问是否存在 ...
分类:
其他好文 时间:
2014-06-08 22:39:57
阅读次数:
331
Given n points on a 2D plane, find the maximum
number of points that lie on the same straight line.思路:(1)点1到点n
(a)以点1为参考点,求“点1”与“点2到点n”各个斜率下点的个数; (求出直...
分类:
其他好文 时间:
2014-06-08 22:30:56
阅读次数:
266
语法概述
下面看一个例子简单过下语法:
例:
sum(sal) over (partition by deptno order by ename) new_alias
sum就是函数名
(sal)是分析函数的参数,每个函数有0~3个参数,参数可以是表达式,例如:sum(sal+comm)
over() 是开窗函数,这是开启分析函数的起点,对于既可作为聚集函数又可作为分析函...
分类:
数据库 时间:
2014-06-08 05:09:07
阅读次数:
329
点击打开链接
题意:给定牛的关系图,求其中一头牛与其他牛关系路程之和sum最小,然后输出 sum*100/(n-1)
floyd求任意两点间的最短路程
注意: inf不能太大,因为 f[i][k] + f[k][j] 做加法时可能会溢出!
#include
#include
const int maxn = 300 + 5;
const int inf = 1<<29;
int...
分类:
其他好文 时间:
2014-06-08 05:07:03
阅读次数:
181
HDU1002--A + B Problem II...
分类:
其他好文 时间:
2014-06-08 04:56:06
阅读次数:
242
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means th...
分类:
其他好文 时间:
2014-06-08 04:05:14
阅读次数:
315
1.多项式的系数存放在数组中
# include
# include
# define max(x,y) ((x)>(y)?(x):(y))
using namespace std;
const int N=100;
struct poly
{
int arr[N];
int mexp;
};
void add(poly &a,poly &b,poly &c)
{
memset(c.ar...
分类:
其他好文 时间:
2014-06-08 02:17:57
阅读次数:
264
题目 :Input: numbers={2, 7, 11, 15}, target=9
Output: index1=1, index2=2
解题思路:
给出一个数组合一个数,如果两个数的和等于所给的数,求出该两个数所在数组中的位置。
这个题也挺常见的,就是两个指针,从前后两个方向扫描。但是本题有以下几个需要的点:
1. 所给数组不是有序的;
2. 返回的下标是从1开始的,并且是原来无序数组中的下标;
3. 输入数组中可能含有重复的元素。
好了,把以上三点想到的话,做这个题应该不会有啥问题。
具体方法:把原...
分类:
其他好文 时间:
2014-06-08 02:14:06
阅读次数:
250