You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路:首先左右翻转,然后按照左下,右上...
分类:
其他好文 时间:
2014-09-03 19:50:47
阅读次数:
241
You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-placen*n矩阵顺时针旋转90度,规律 a[i...
分类:
其他好文 时间:
2014-09-02 17:14:04
阅读次数:
180
************◆Margin属性:适合对象:所有元素是否继承:no百分比备注:相对于BOX的宽度2D Transform 方法实例div{transform: rotate(30deg);-ms-transform: rotate(30deg); /* IE 9 */-webkit-tr....
分类:
Web程序 时间:
2014-09-01 00:26:02
阅读次数:
249
/*help*/.help{ position: relative; width: 130px; height: 130px; border: 6px #fff solid; border-radius: 50%; -webkit-animation: rotation 1s ease-in...
分类:
Web程序 时间:
2014-08-31 15:48:01
阅读次数:
520
/* Timer*/.timer{ width: 240px; height: 240px; background-color: transparent; box-shadow: inset 0px 0px 0px 2px #fff; border: 2px #f00 solid; border-r...
分类:
Web程序 时间:
2014-08-30 19:03:29
阅读次数:
4133
题意:给定一个 n * n 的二维图像,将该图像顺时针旋转 90 度
思路:
先沿副对角线翻转一次,再沿水平中线翻转一次
复杂度:时间O(n^2),空间O(1)
void rotate(vector<vector > &matrix){
int n = matrix.size();
//沿副对角线翻转
for(int i = 0; i < n; ++i){
for(int j = 0; j < n - i; ++j){
int i2 = n - 1 - j, j2 = n - ...
分类:
其他好文 时间:
2014-08-30 16:29:09
阅读次数:
182
不涉及什么算法,只是简单的套用模板进行计算。
如果一个向量进行逆时针旋转,那么可以使用定义的函数 Rotate(v,rad)进行计算。
但是如果进行顺时针旋转,那么需要将rad改为-rad,也就是Rotate(v,-rad)进行计算。
精度的控制为 1e-10;
14112243
11178
Morley's Theorem
Accepted
C...
分类:
其他好文 时间:
2014-08-29 20:08:28
阅读次数:
282
Transform变形:可以实现文字或者图片旋转、缩放、倾斜和移动,并且该元素下的所有子元素都随着父元素一样。既然接触到transform,我们就可以做好多3d的效果啦旋转:transform:rotate(角度deg)deg是css3的“Values and Units”模块中定义的一个角度单位....
分类:
Web程序 时间:
2014-08-28 17:51:55
阅读次数:
237
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?思路:对于matrix[i][...
分类:
其他好文 时间:
2014-08-27 16:06:57
阅读次数:
179
div{transform:rotate(7deg);-ms-transform:rotate(7deg); /* IE 9 */-moz-transform:rotate(7deg); /* Firefox */-webkit-transform:rotate(7deg); /* ...
分类:
Web程序 时间:
2014-08-27 12:33:37
阅读次数:
205