图片放大的思路: 第一、可以通过Matrix对象来变换图像,在选择的时候放大,在失去焦点的时候,缩小到原来的大小。double scale = 1.2;int width = bm.getWidth();int height = bm.getHeight();Log.i("size:", wi...
分类:
移动开发 时间:
2014-07-09 16:35:13
阅读次数:
234
Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.题解:因为题目要求原地算法,所以我们只能利用矩阵第一行和第一列存放置零信息。首先遍历第一行和第一列,看他们是否需要全部置零...
分类:
其他好文 时间:
2014-07-08 23:58:29
阅读次数:
422
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2014-07-08 23:54:39
阅读次数:
407
Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0.
分类:
其他好文 时间:
2014-07-08 22:17:29
阅读次数:
193
Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do th...
分类:
其他好文 时间:
2014-07-08 22:06:25
阅读次数:
222
我在梦中想到超级计算机是超算电脑,采用大量阵列cpu和内存,完成并发计算。有个手机厂家提供服务因为使用普通机器,导致经常宕机,其实铁道部火车网络售票就是。
因为不能采用云服务,上万台计算机并行处理,所以处理能力是不够的。
于是我设计了一台电脑,主板上再插上几个小主板,小主板上有cpu,内存,固态存储等,大小跟光驱差不多,插上4个,8个,16个,完成阵列计算,通过操作系统分配计算到阵列上,从而高...
分类:
其他好文 时间:
2014-07-08 18:09:17
阅读次数:
219
这要是碰上现场赛我得被搞死 从RE到TLE到WA已疯。。
这题建图没有那么直接,通过给出的不等式关系一时想不到怎么建图
所以要对题目给的条件一定程度化简,将不等式两边取对数化简得到Sa-Sb
要注意w取double类型
其次,这题卡时间,根据经验加剪枝:
1、出队次数>sqrt(n)则判断有负环
2、统计总的入队次数,>2n则判断有负环
一般情况下不用这个,因为不严谨
...
分类:
其他好文 时间:
2014-07-08 17:02:17
阅读次数:
220
项目原理概述利用sqoop将数据从MySQL导入到HDFS中,利用mahout的LDA的cvb实现对输入数据进行聚类,并将结果更新到数据库中。数据流向图如下mahout算法分析输入数据格式为的matrix矩阵,key为待聚类文本的数字编号,value为待聚类文本的单词向量Vector, Vector...
分类:
其他好文 时间:
2014-07-07 10:43:16
阅读次数:
1186
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.public class Solution { public...
分类:
其他好文 时间:
2014-07-06 13:50:22
阅读次数:
153
在C语言中,我们常常用到的一个运算是让某个变量的值+1.
例如 M = M + 1。
而在实际运用中,我们发现
对于指针进行+1运算,算出来的结果是+4。
如下图
图中我们定义的 变量M 和指针Matrix如下:
int M = 3;
int* Matrix = {1,2,3};
可以看到,对于M和 Matrix ,+1运算的效果是不同的。
这个差异是因为...
分类:
编程语言 时间:
2014-07-03 16:02:56
阅读次数:
273