构造数据: > dataset = matrix(c(1,2,
+ 1.2,2,
+ 8,9,
+ 0.9,1.8,
+ 7,10,
+ 8.8,9.2), nrow=6, byrow=T)
> dataset
[,1] [,2]
[1,] 1.0 2.0
[2,] 1.2 2.0
[3,] 8.0 9.0
[4,] 0.9 1.8
[5,] 7.0 1...
分类:
其他好文 时间:
2014-10-05 15:27:28
阅读次数:
373
例如要把一组数据分成两个簇: > dataset = matrix(c(1,2,
+ 1.2,2,
+ 8,9,
+ 0.9,1.8,
+ 7,10,
+ 8.8,9.2), nrow=6, byrow=T)
> dataset
[,1] [,2]
[1,] 1.0 2.0
[2,] 1.2 2.0
[3,] 8.0 9.0
[4,] 0....
分类:
其他好文 时间:
2014-10-05 12:29:28
阅读次数:
221
Kaka's Matrix Travels
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 8006
Accepted: 3204
Description
On an N × N chessboard with a non-negative number i...
分类:
其他好文 时间:
2014-10-05 11:40:38
阅读次数:
281
==线代好难
#include
#include
#include
#include
#include
#include
#include
template
inline bool rd(T &ret) {
char c; int sgn;
if(c=getchar(),c==EOF) return 0;
while(c!='-'&&(c'9')...
分类:
其他好文 时间:
2014-10-05 01:27:37
阅读次数:
293
在~下有一文本文件matrix.dat内容如下: 99 102 3
12 43 213.0
12 12 2
23 21 211 方式1: > A <- matrix(scan("~/matrix.dat", n = 3*4), 3, 4, byrow = TRUE)
Read 12 items
> A
[,1] [,2] [,3] [,4]
[1...
分类:
其他好文 时间:
2014-10-05 00:47:17
阅读次数:
307
Divides one thing entire to many objects;Like perspectives, which rightly gazed uponShow nothing but confusion. . .—William Shakespeare, The Tragedy o...
分类:
编程语言 时间:
2014-10-04 14:19:56
阅读次数:
275
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 16202
Accepted: 4349
Description
Given a M×N matrix A. Aij ∈ {0, 1} (0 ≤ i < M, 0 ≤ j < N), could you find some ro...
分类:
其他好文 时间:
2014-10-03 22:39:25
阅读次数:
275
Easy Finding
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 16178
Accepted: 4343
Description
Given a M×N matrix A. Aij ∈ {0, 1} (0 ≤ i < M, 0 ≤ j < N), co...
分类:
其他好文 时间:
2014-10-03 19:55:45
阅读次数:
198
题意:
给定n个点的树,m个黑点
下面n-1行给出边和删除这条边的费用
下面m个黑点的点标[0,n-1]
删除一些边使得任意2个黑点都不连通。
问删除的最小花费。
思路:
树形dp
每个点有2个状态,成为黑点或白点。
若本身这个点就是黑点那么只有黑点一种状态。
否则可以认为是子树中某个黑点转移上来。
所以dp[i][0]是i点为黑点的状态。
#pragma comm...
分类:
其他好文 时间:
2014-10-02 20:59:23
阅读次数:
320
UVA11992 - Fast Matrix Operations(线段树区间修改)
题目链接
题目大意:给你个r*c的矩阵,初始化为0。
然后给你三种操作:
1 x1, y1, x2, y2, v 把由x1,y1, x2, y2构成的子矩阵里的每个元素都加上v。
2 x1, y1, x2, y2, v 把这个子矩阵的每个元素都修改为v。
3 x1, y1, x2, y2 查询...
分类:
其他好文 时间:
2014-10-02 14:51:43
阅读次数:
244