HDOJ 233 Matrix 5015

纯套板子题
找出列与列之间的递推关系;
|10 10 10 10 0 | | 2310 + 3 |
| 0 1 1 1 0 | | a1 + 23
10 + 3 |
| 23 a1 a2 a3 3 | | 0 0 1 1 0 | = | a1+a2+2310+3 |
| 0 0 0 1 0 | |a1+a2+a3+23
10+3 |
| 1 1 1 1 1 | | 3 |

嗯,就是这样 n+2个数做m次矩阵乘法
然后就没有然后了。。。。。。
上代码

#include
#include
#include
#include
#include
#define LL long long 
using namespace std;
const int mod = 10000007;
struct mat
{
    int m[15][15];
}unit;


int n; 
 void print(mat tmp)
{
    printf("**************8\n");
    for(int i=0;i>= 1;
    }
    return ret;
}
mat create()
{
    mat tmp;
    memset(tmp.m,0,sizeof(tmp.m));
    for(int i = 0;i < n-1;i++)  tmp.m[0][i] = 10;
    for(int i = 0;i < n;i++)  tmp.m[n-1][i] = 1;
    for(int i=1;i

你可能感兴趣的:(HDOJ 233 Matrix 5015)