和这一题构造的矩阵的方法相同。
需要注意的是,题目中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
1001暴力#include #include #include using namespace
std;const int maxn = 100100;int ll[maxn], rr[maxn];struct node{ int x, y,
bj;}e[maxn];int main(){ int...
分类:
其他好文 时间:
2014-06-12 18:51:11
阅读次数:
238
原来这么长时间没写了,今天阅读《集体智慧编程》的时候,发现了python的一个功能,列表推导式。留个存[ 表达式 for 变量 in 列表] 或者[表达式
for 变量 in 列表 if 条件]例如:ll=[1,2,3,4,5,6,7,8,9,0]print (v*10 for v in ll if...
分类:
编程语言 时间:
2014-06-11 11:23:16
阅读次数:
330
shell简介
shell是用户和linux内核进行交流的中间层,用户编写的命令就是通过shell解析并交给Linux Kernel执行。 查看当前系统安装的shell
1.查看/etc/shells 2.ll /bin/*sh 可以看出当前系统中存在的shell只有bash、dash、tcsh三种...
分类:
其他好文 时间:
2014-06-11 07:24:46
阅读次数:
263
【题解】:【代码】: 1 #include 2 #include 3 #include 4
#define LL long long 5 using namespace std; 6 7 bool
dp[505][505];//已经用了i个人,已分配出j个任务 8 LL S[505]; 9 ...
分类:
其他好文 时间:
2014-06-10 10:39:06
阅读次数:
159
http://poj.org/problem?id=1095先求出n个节点数的二叉树的形态有多少种。卡特兰数f[n]=f[n-1]*(4*n-2)/(n+1);再递归求。
1 #include 2 #include 3 #include 4 #define ll long long 5 #de...
分类:
其他好文 时间:
2014-06-09 15:14:11
阅读次数:
167
文件,目录 pwd:查看当前目录 Print Working Directory
cd,ls(ll),mkdir -p Change Directory List Make Directory du -sh 评估目录或者文件大小 touch
创建新文件 ln -s source dest ...
分类:
系统相关 时间:
2014-06-09 00:05:22
阅读次数:
334
【题解】:【代码】: 1 #include 2 #include 3 #include 4
#include 5 #include 6 #define LL long long 7 using namespace std; 8 LL
dp[15][100005]; 9 LL N,h,uh,...
分类:
其他好文 时间:
2014-06-08 20:08:41
阅读次数:
261
解法:直接上模版。
扩展欧几里德的模版:
typedef long long LL;
LL ex_gcd(LL a,LL b,LL &x,LL &y)
{
if(b==0)
{
x=1;
y=0;
return a;
}
LL d=ex_gcd(b,a%b,x,y);
LL t=x;
x=y;...
分类:
其他好文 时间:
2014-06-08 16:56:35
阅读次数:
228