码迷,mamicode.com
首页 >  
搜索关键字:spiral matrix    ( 4337个结果
POJ3233(矩阵二分再二分)
题目很有简单: Description Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak. Output S mod m 范围:n (n ≤ 30), k (k ≤ 109) and m (m 4).  显然,暴力是不能解决问题,这题目很有意思...
分类:其他好文   时间:2014-10-29 19:29:27    阅读次数:176
[LeetCode]Set Matrix Zeroes
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click to show follow up. Follow up: Did you use extra space? A straight forward solution using O(m...
分类:其他好文   时间:2014-10-29 17:02:17    阅读次数:206
poj 1147 Binary codes
Binary codes Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5647   Accepted: 2201 Description Consider a binary string (b1…bN) with N binary digits. Given s...
分类:其他好文   时间:2014-10-29 14:59:04    阅读次数:127
zoj3497Mistwald矩阵
判断i到j 是否k步可达。#include #include #include #include typedef long long LL;using namespace std;int n;int x[100], y[100];struct Matrix{ int m[40][40];...
分类:其他好文   时间:2014-10-29 14:42:44    阅读次数:206
POJ 2155 树套树—线段树套线段树
Matrix 楼教主出的题目。 题意:一个矩阵初始值都为0,每次给“C X1 Y1 X2 Y2" 去反转这个矩阵。或者"Q X1 Y1"查询这个点是0/1。 第一次接触树套树的题目。 一句AC:对于基本的线段树,再在每个节点建一个y方向上的线段树。tree[n][m] 这道题目更新的时候,对于X方向就是(X1,X2)这个区间,再在其上对Y1,Y2进行更新。 对于查询,X方向上,自顶向下到...
分类:其他好文   时间:2014-10-29 10:53:37    阅读次数:156
DM8168 新板系统启动
DM8168新板从贴片到系统启动折腾了二十多天终于完成,高校里做个东西好累,导师只给机焊10个BGA,别的都是手工。 前段时间启动操作系统时,到了Starting Matrix GUI application。。。 出现了 pgd = c0004000 的毛病,查了很久没找到合适的答案,最后回到log看到一句提示: Unable to handle kerne...
分类:其他好文   时间:2014-10-29 00:28:05    阅读次数:263
Hdu3233Matrix Power Series矩阵
前面就做过了。。。二分搞下#include #include #include #include typedef long long LL;using namespace std;int n, M;struct Matrix{ int m[40][40];};Matrix Mul(Matrix...
分类:其他好文   时间:2014-10-29 00:05:19    阅读次数:179
Hdu1575Tr A矩阵
矩阵快速幂,就是快速幂的乘法变成矩阵乘法,其余的都一样。#include #include #include #include using namespace std;const int mod = 9973;const int maxn = 12;struct Matrix{ int m[m...
分类:其他好文   时间:2014-10-29 00:04:18    阅读次数:267
Hdu1588Gauss Fibonacci矩阵
题意:求g(i)=k*i+b; f(g(i)) for 0#include #include #include typedef long long LL;LL M;using namespace std;struct Matrix{ LL m[4][4];};Matrix Mul(Matrix...
分类:其他好文   时间:2014-10-28 19:36:49    阅读次数:170
poj 3233 Matrix Power Series(矩阵二分,快速幂)
Matrix Power Series Time Limit: 3000MS   Memory Limit: 131072K Total Submissions: 15739   Accepted: 6724 Description Given a n × n matrix A and a positive integer k, fi...
分类:其他好文   时间:2014-10-28 10:25:00    阅读次数:158
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!