摘要:
题目大意:对一个长度为n(n #include using namespace std;const int MAXN=50005;int c[105][MAXN],begin[MAXN],n,m;void update(int k,int x,int val){while(x<=n)c[k][x]+=val,x+=x&-x;}int getsum(int pos){ int s=0; for(int i=1;i<=10;i++){ int k=10*(i-1)+pos%i,x=pos; while(x)s+=c[k][x],x-=x&-x; }re... 阅读全文
摘要:
/*matrix a={ {0,1,0,0,0,0,0,0,0,0}, {0,0,1,0,0,0,0,0,0,0}, {0,0,0,1,0,0,0,0,0,0}, {0,0,0,0,1,0,0,0,0,0}, {0,0,0,0,0,1,0,0,0,0}, {0,0,0,0,0,0,1,0,0,0}, {0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,1,0}, {0,0,0,0,0,0,0,0,0,1},{1,1,1,1,1,1,1,1,1,1}, }; */#include #include #define maxn 15#define rep(i,n) for( 阅读全文