和这一题构造的矩阵的方法相同。
需要注意的是,题目中a0~a9 与矩阵相乘的顺序。
#include
#include
#include
#include
#include
#define N 10
using namespace std;
int mod;
typedef long long LL;
struct matrix
{
LL a[10][10];
}...
分类:
其他好文 时间:
2014-06-16 12:06:07
阅读次数:
231
题目
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?
方法
矩阵坐标的转换,循环替换。
public voi...
分类:
其他好文 时间:
2014-06-16 11:28:03
阅读次数:
199
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?
思路:第一种思路是一层一层的进行旋转,比较直观,但是花费的时间要久一些;第二种思路则比较取巧,首先沿着...
分类:
其他好文 时间:
2014-06-15 08:46:26
阅读次数:
170
SQLite介绍SQLite is a software library that
implements aself-contained,serverless,zero-configuration,transactionalSQL
database engine.SQLite是一个开源、免费的小型R...
分类:
数据库 时间:
2014-06-13 15:42:19
阅读次数:
274
Supporting Connected Routes to Subnet ZeroIOS
allows the network engineer to tell a router to either allow addresses in the
zero subnet or not. The mo...
分类:
Web程序 时间:
2014-06-13 15:04:27
阅读次数:
374
姓名 年龄 地址 zero 0 wuhan one 23 ...
分类:
其他好文 时间:
2014-06-12 06:12:17
阅读次数:
364
1 #ifndef __MAPLE_MATRIX_H__ 2 #define
__MAPLE_MATRIX_H__ 3 4 #include "maple.h" 5 6 typedef struct MATRIX{ 7 union{ 8
...
分类:
其他好文 时间:
2014-06-10 16:04:42
阅读次数:
159
题目...
二维数组中的查找,这是个简单的题,根据题意可以推出,这个二维数组其实是一个有序的一维数组。解决思路也很容易想到,每次比较每一维最后一个元素,如果该元素比要找的元素小,说明这个行不可能含该元素;如果相等,那就找到了,如果最后一个元素比要找元素大,说明该元素如果出现比在这一行。然后再在这一行中就行查找(可以用顺序,也可二分)。
代码如下:...
分类:
其他好文 时间:
2014-06-10 14:49:37
阅读次数:
233
1 #ifndef __MAPLE_MATRIX_H__ 2 #define
__MAPLE_MATRIX_H__ 3 4 #include "maple.h" 5 6 typedef struct MATRIX{ 7 union{ 8
...
分类:
其他好文 时间:
2014-06-10 10:28:48
阅读次数:
310