You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?抠细节的题,题目思想如下:to...
分类:
其他好文 时间:
2014-06-28 22:11:37
阅读次数:
214
题目链接题意 : 用矩阵相乘求斐波那契数的后四位。思路 :基本上纯矩阵快速幂。 1 //3070 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 struct Matrix 9 {10 int v[2][2...
分类:
其他好文 时间:
2014-06-28 17:48:14
阅读次数:
214
题目链接题意 : 给你三个n维矩阵,让你判断A*B是否等于C。思路 :优化将二维转化成一维的。随机生成一个一维向量d,使得A*(B*d)=C*d,多次生成多次测试即可使错误概率大大减小。 1 //3318 2 #include 3 #include 4 #include 5 #include ...
分类:
其他好文 时间:
2014-06-28 17:00:21
阅读次数:
133
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:
其他好文 时间:
2014-06-28 15:14:05
阅读次数:
194
1 /* 2 poj3422 Kaka's Matrix Travels 3 不知道 k次 dp做为什么不对??? 4 看了大牛的代码,才知道还可以这样做! 5 开始没有理解将a 和 a‘ 之间建立怎样的两条边,导致程序一直陷入死循环,真心花了好长时间,快崩溃了。无语..... ...
分类:
其他好文 时间:
2014-06-28 11:41:06
阅读次数:
300
【Unity3D Physics Keynote】1、在哪设置Layer Collision Matrix? "Edit"->"Project Settings"->"Physics"。 2、“Import Package”->"Physic Meterial",是Unity自带的物理材质包。3.....
分类:
其他好文 时间:
2014-06-28 11:12:40
阅读次数:
221
一. 概述
职责链模式:
使多个对象都有机会处理请求,从而避免请求的发送者和接收者之间的耦合关系。将这些对象连成一条链,并沿着这条链传递该请求,直到有一个对象处理它为止。
二. 举个例子
员工要求加薪
公司的管理者一共有三级:总经理、总监、经理,如果一个员工要求加薪,应该向主管的经理申请,如果加薪的数量在经理的职权内,那么经理可以直接批准,否则将申请上交给总监。总...
分类:
编程语言 时间:
2014-06-22 14:46:52
阅读次数:
300
题目要求:
Input a value n, then print out a N×N matrix.
Example 1: Input 2, then
1 2
4 3
Example2: Input 4, then
1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7
Please write a program to...
分类:
其他好文 时间:
2014-06-22 00:38:02
阅读次数:
409
链接简单的两种操作,一种删除某段区间,加在第I个点的后面,另一个是翻转区间。都是splay的简单操作。悲剧一:pushdown时候忘记让lz=0悲剧二:删除区间,加在某点之后的时候忘记修改其父亲节点。 1 #include 2 #include 3 #include 4 #include ...
分类:
其他好文 时间:
2014-06-20 16:55:12
阅读次数:
291
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted fr...
分类:
其他好文 时间:
2014-06-20 15:29:46
阅读次数:
233