[矩阵乘法/快速幂专题]Arc of Dream,Recursive sequence,233 Matrix,Training little cats

矩阵快速幂习题

  • 复习矩阵乘法及快速幂模板
    • 乘法模板
    • 快速幂模板
  • T1:Arc of Dream
    • 题目
    • 题解
    • code
  • T2:Recursive sequence
    • 题目
    • 题解
    • code
  • T3:233 Matrix
    • 题目
    • 题解
    • code
  • T4:Training little cats
    • 题目
    • 题解
    • code

做题的时候后悔没有保存过模板,还到处去找自己曾经写过的模板,然并卵,还是重新写了一遍,其实如果知道原理,就不用背模板了
每次复习的时候打完就觉得自己记住了,然而在这里插入图片描述

复习矩阵乘法及快速幂模板

具体怎么乘的,移步百度百科
在这里插入图片描述

乘法模板

struct Matrix {int n, m;LL c[MAXN][MAXN];Matrix () {memset ( c, 0, sizeof ( c ) );}Matrix operator * ( const Matrix &a ) const {Matrix res;res.n = n;res.m = a.m;for ( int i = 1;i <= n;i ++ )for ( int j = 1;j <= a.m;j ++ )for ( int k = 1;k <= m;k ++ )res.c[i][j] = ( res.c[i][j] + c[i][k] * a.c[k][j] % mod ) % mod;			return res;}
};

快速幂模板

Matrix qkpow ( Matrix &a, LL b ) {Matrix res;res.n = a.n;res.m = a.m;for ( int i = 1;i <= res.n;i ++ )res.c[i][i] = 1;while ( b ) {if ( b & 1 )res = res * a;a = a * a;b >>= 1;}return res;
}

T1:Arc of Dream

题目

梦想之弧是由以下函数定义的曲线:
∑i=0n−1aibi\sum_{i=0}^{n-1}a_ib_ii=0n1aibi
其中
a0=A0a_0 = A0a0=A0
ai=ai−1∗AX+AYa_i = a_{i-1} * AX + AYai=ai1AX+AY
b0=B0b_0 = B_0b0=B0
bi=bi−1∗BX+BYb_i = b_{i-1} * BX + BYbi=bi1BX+BY
AoD(N)取1,000,000,007模的值是多少?
输入项
有多个测试用例。处理到文件末尾。
每个测试用例包含以下7个非负整数:
N
A0 AX AY
B0 BX BY
N不大于101810^{18}1018,所有其他整数不大于2×1092×10^92×109
输出量
对于每个测试用例,以模1,000,000,007输出AoD(N)。
样本输入
1
1 2 3
4 5 6
2
1 2 3
4 5 6
3
1 2 3
4 5 6
样本输出
4
134
1902

题解

首先最后快速幂后肯定要有求和的答案,所以要占一位,接着把转移要用到的AX,AY...AX,AY...AX,AY...也甩进加速矩阵中,然后发现转移后的ai,bia_i,b_iai,bi还要加上某一些常数,所以我们还要给一位常数项,我们可以把初始矩阵定义常数项为111,在加速矩阵中再乘上常数


初始矩阵
[0(当前求和答案),a0∗b0,a0,b0,1(常数项)]\begin{bmatrix} 0(当前求和答案),a_0*b_0,a_0,b_0,1(常数项) \end{bmatrix} [0()a0b0a0b01()]
考虑如何转移,写出加速矩阵
在这里插入图片描述
[100001AX∗AY0000AXAX000BX0BX00AY∗BYAYBY1]\begin{bmatrix} 1&0&0&0&0\\ 1&AX*AY&0&0&0\\ 0&AX&AX&0&0\\ 0&BX&0&BX&0\\ 0&AY*BY&AY&BY&1\\ \end{bmatrix} 110000AXAYAXBXAYBY00AX0AY000BXBY00001


这一题我仔细地推一遍,后面就不仔细推了,可能直接给加速矩阵和初始矩阵
在这里插入图片描述

code

#include <cstdio>
#include <cstring>
#define LL long long
#define mod 1000000007
#define MAXN 10
LL N, A0, Ax, Ay, B0, Bx, By;
struct Matrix {int n, m;LL c[MAXN][MAXN];Matrix () {memset ( c, 0, sizeof ( c ) );}Matrix operator * ( const Matrix &a ) const {Matrix res;res.n = n;res.m = a.m;for ( int i = 1;i <= n;i ++ )for ( int j = 1;j <= a.m;j ++ )for ( int k = 1;k <= m;k ++ )res.c[i][j] = ( res.c[i][j] + c[i][k] * a.c[k][j] % mod ) % mod;			return res;}void read () {for ( int i = 1;i <= n;i ++ )for ( int j = 1;j <= m;j ++ )scanf ( "%lld", &c[i][j] );}void print () {printf ( "%lld\n", c[1][1] );}
}A;Matrix qkpow ( Matrix &a, LL b ) {Matrix res;res.n = a.n;res.m = a.m;for ( int i = 1;i <= res.n;i ++ )res.c[i][i] = 1;while ( b ) {if ( b & 1 )res = res * a;a = a * a;b >>= 1;}return res;
}int main() {while ( ~ scanf ( "%lld", &N ) ) {scanf ( "%lld %lld %lld %lld %lld %lld", &A0, &Ax, &Ay, &B0, &Bx, &By );Matrix res;res.n = res.m = 5;res.c[1][1] = res.c[2][1] = res.c[5][5] = 1;res.c[2][2] = Ax * Bx % mod;res.c[3][2] = Ax * By % mod;res.c[3][3] = Ax % mod;res.c[4][2] = Bx * Ay % mod;res.c[4][4] = Bx % mod;res.c[5][2] = Ay * By % mod;res.c[5][3] = Ay % mod;res.c[5][4] = By % mod;res = qkpow ( res, N );A.n = 1;A.m = 5;A.c[1][1] = 0;A.c[1][2] = A0 * B0 % mod;A.c[1][3] = A0 % mod;A.c[1][4] = B0 % mod;A.c[1][5] = 1;A = A * res;A.print();}return 0;
}

T2:Recursive sequence

题目

Farmer John likes to play mathematics games with his N cows. Recently, they are attracted by recursive sequences. In each turn, the cows would stand in a line, while John writes two positive numbers a and b on a blackboard. And then, the cows would say their identity number one by one. The first cow says the first number a and the second says the second number b. After that, the i-th cow says the sum of twice the (i-2)-th number, the (i-1)-th number, and i^4. Now, you need to write a program to calculate the number of the N-th cow in order to check if John’s cows can make it right.

Input
The first line of input contains an integer t, the number of test cases. t test cases follow.
Each case contains only one line with three numbers N, a and b where N,a,b<231N,a,b < 2^{31}N,a,b<231 as described above.
Output
For each test case, output the number of the N-th cow. This number might be very large, so you need to output it modulo 2147493647.

Sample Input
2
3 1 2
4 1 10
Sample Output
85
369

Hint
In the first case, the third number is 85=2∗1十2十3485 = 2*1十2十3^485=21234.
In the second case, the third number is 93=2∗1十1∗10十3493 = 2*1十1*10十3^493=2111034 and the fourth number is 369=2∗10十93十44369 = 2 * 10 十 93 十 4^4369=2109344.
一句话题意
给定a,ba,ba,b分别为第一项和第二项求第n项,第i项等于2(i−2)+(i−1)+i42(i-2)+(i-1)+i^42(i2)+(i1)+i4

题解

2(i−1),(i−1)2(i-1),(i-1)2(i1),(i1)都很好转移,但是i4i^4i4就有点难了,我们可以这样处理
i4=(i−1+1)4i^4=(i-1+1)^4i4=(i1+1)4,将i−1i-1i1看作一个整体,这样就运用二项式展开,用到杨辉三角1,4,6,4,11,4,6,4,11,4,6,4,1,但是这个时候又要知道i3,i2,i1,i0=1i^3,i^2,i^1,i^0=1i3,i2,i1,i0=1才能进行转移,用同样的方式处理它们,就可以进行转移了


初始矩阵
a,b,21,22,23,24,1a,b,2^1,2^2,2^3,2^4,1a,b,21,22,23,24,1
加速矩阵(就不推了,直接给)
[0200000110000004123400601360040014001000100111111]\begin{bmatrix} 0&2&0&0&0&0&0\\ 1&1&0&0&0&0&0\\ 0&4&1&2&3&4&0\\ 0&6&0&1&3&6&0\\ 0&4&0&0&1&4&0\\ 0&1&0&0&0&1&0\\ 0&1&1&1&1&1&1\\ \end{bmatrix} 0100000214641100100010021001003310100464110000001
在这里插入图片描述

code

#include <cstdio>
#include <cstring>
#define mod 2147493647
#define LL long long
#define maxn 10
int t;
LL n, a, b;struct Matrix {int n, m;LL c[maxn][maxn];Matrix () {memset ( c, 0, sizeof ( c ) );}Matrix operator * ( const Matrix &a ) const {Matrix res;res.n = n;res.m = a.m;for ( int i = 1;i <= n;i ++ )for ( int j = 1;j <= a.m;j ++ )for ( int k = 1;k <= m;k ++ )res.c[i][j] = ( res.c[i][j] + c[i][k] * a.c[k][j] % mod ) % mod;			return res;}void print() {printf ( "%lld\n", c[1][2] );}
}A;Matrix qkpow ( Matrix a, LL b ) {Matrix ans;ans.n = ans.m = a.n;for ( int i = 1;i <= a.n;i ++ )ans.c[i][i] = 1;while ( b ) {if ( b & 1 )ans = ans * a;a = a * a;b >>= 1;}return ans;
}int main() {scanf ( "%d", &t );while ( t -- ) {scanf ( "%lld %lld %lld", &n, &a, &b );if ( n == 1 )printf ( "%lld\n", a );if ( n == 2 )printf ( "%lld\n", b );Matrix tmp;tmp.n = tmp.m = 7;tmp.c[2][1] = tmp.c[2][2] = tmp.c[3][3] = tmp.c[4][4] = tmp.c[5][5] = tmp.c[6][2] = tmp.c[6][6] = tmp.c[7][2] = tmp.c[7][3] = tmp.c[7][4] = tmp.c[7][5] = tmp.c[7][6] = tmp.c[7][7] = 1;tmp.c[1][2] = tmp.c[3][4] = 2;tmp.c[3][5] = tmp.c[4][5] = 3;tmp.c[3][2] = tmp.c[3][6] = tmp.c[5][6] = tmp.c[5][2] = 4;tmp.c[4][2] = tmp.c[4][6] = 6;tmp = qkpow ( tmp, n - 2 );A.n = 1;A.m = 7;A.c[1][1] = a;A.c[1][2] = b;A.c[1][3] = 2;A.c[1][4] = 4;A.c[1][5] = 8;A.c[1][6] = 16;A.c[1][7] = 1;A = A * tmp;A.print();}return 0;
}

T3:233 Matrix

题目

In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 … in the same meaning. And here is the question: Suppose we have a matrix called 233 matrix. In the first line, it would be 233, 2333, 23333… (it means a 0,1 = 233,a 0,2 = 2333,a 0,3 = 23333…) Besides, in 233 matrix, we got a i,j = a i-1,j +a i,j-1( i,j ≠ 0). Now you have known a 1,0,a 2,0,…,a n,0, could you tell me a n,m in the 233 matrix?
Input
There are multiple test cases. Please process till EOF.

For each case, the first line contains two postive integers n,m(n ≤ 10,m ≤ 10^9). The second line contains n integers, a 1,0,a 2,0,…,a n,0(0 ≤ a i,0 < 2 31).
Output
For each case, output a n,m mod 10000007.
Sample Input
1 1
1
2 2
0 0
3 7
23 47 16
Sample Output
234
2799
72937

Hint
在这里插入图片描述

题解

看图↓:
我们可以考虑用对角线去处理,因为nnn很小,可以暴力算出第一根红线之前所有点的值
然后画出平移的一条线发现转移规律,除了第一个点是直接由上一条线第一个点转移,其余的点都是上一条线的对应点和上一个点的和,我们以第一条对角线为初始矩阵,那么进行mmm次转移即可,用快速幂搞定

加速矩阵为:
[110...00011...00001...00......000...10000...11000...01]\begin{bmatrix} 1&1&0&...&0&0\\ 0&1&1&...&0&0\\ 0&0&1&...&0&0\\ .&.&.&.&.&.\\ 0&0&0&...&1&0\\ 0&0&0&...&1&1\\ 0&0&0&...&0&1 \end{bmatrix} 100.000110.000011.000...................000.110000.011
在这里插入图片描述
在这里插入图片描述

code

#include <cstdio>
#include <cstring>
#define mod 10000007
#define LL long long
#define maxn 15
LL n, m;
LL a[maxn][maxn];struct Matrix {int n, m;LL c[maxn][maxn];Matrix () {memset ( c, 0, sizeof ( c ) );}Matrix operator * ( const Matrix &a ) const {Matrix res;res.n = n;res.m = a.m;for ( int i = 1;i <= n;i ++ )for ( int j = 1;j <= a.m;j ++ )for ( int k = 1;k <= m;k ++ )res.c[i][j] = ( res.c[i][j] + c[i][k] * a.c[k][j] % mod ) % mod;			return res;}void print() {printf ( "%lld\n", c[1][m - 1] );}
}A;Matrix qkpow ( Matrix a, LL b ) {Matrix ans;ans.n = ans.m = a.n;for ( int i = 1;i <= a.n;i ++ )ans.c[i][i] = 1;while ( b ) {if ( b & 1 )ans = ans * a;a = a * a;b >>= 1;}return ans;
}int main() {while ( ~ scanf ( "%lld %lld", &n, &m ) ) {for ( int i = 1;i <= n;i ++ )scanf ( "%lld", &a[i][0] );a[0][1] = 233;for ( int i = 2;i <= n;i ++ )a[0][i] = ( a[0][i - 1] * 10 % mod + 3 ) % mod;for ( int i = 1;i <= n;i ++ )for ( int j = 1;j <= n - i;j ++ )a[i][j] = ( a[i - 1][j] + a[i][j - 1] ) % mod;A.n = 1;A.m = n + 2;for ( int i = 1;i <= n + 1;i ++ )A.c[1][i] = a[i - 1][n - i + 1];A.c[1][n + 2] = 3;Matrix res;res.n = res.m = n + 2;res.c[1][1] = 10;res.c[n + 2][1] = res.c[n + 2][n + 2] = 1;for ( int i = 2;i <= n + 1;i ++ )res.c[i][i] = res.c[i - 1][i] = 1;res = qkpow ( res, m );A = A * res;A.print();}return 0;
}

T4:Training little cats

题目

Facer’s pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make the cats to do some exercises. Facer has well designed a set of moves for his cats. He is now asking you to supervise the cats to do his exercises. Facer’s great exercise for cats contains three different moves:
g i : Let the ith cat take a peanut.
e i : Let the ith cat eat all peanuts it have.
s i j : Let the ith cat and jth cat exchange their peanuts.
All the cats perform a sequence of these moves and must repeat it m times! Poor cats! Only Facer can come up with such embarrassing idea.
You have to determine the final number of peanuts each cat have, and directly give them the exact quantity in order to save them.

Input
The input file consists of multiple test cases, ending with three zeroes “0 0 0”. For each test case, three integers n, m and k are given firstly, where n is the number of cats and k is the length of the move sequence. The following k lines describe the sequence.
(m≤1,000,000,000, n≤100, k≤100)

Output
For each test case, output n numbers in a single line, representing the numbers of peanuts the cats have.

Sample Input
3 1 6
g 1
g 2
g 2
s 1 2
g 3
e 2
0 0 0
Sample Output
2 0 1

题解

分三种情况,可以考虑多给加速矩阵提供一行常数项
ggg就直接+1+1+1
eee就将该只小猫的那一列全部清零
sss就直接swapswapswap交换两列
最后直接快速幂即可,比较简单
在这里插入图片描述

code

#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define LL long long
#define maxn 105struct Matrix {int n, m;LL c[maxn][maxn];Matrix () {memset ( c, 0, sizeof ( c ) );}Matrix operator * ( const Matrix &a ) {Matrix ans;ans.n = n;ans.m = a.m;for ( int i = 1;i <= n;i ++ )for ( int k = 1;k <= m;k ++ )if ( c[i][k] )for ( int j = 1;j <= a.m;j ++ )ans.c[i][j] += c[i][k] * a.c[k][j];return ans;}void print() {for ( int i = 1;i < m;i ++ )printf ( "%lld ", c[1][i] );printf ( "\n" );}
}A;Matrix qkpow ( Matrix a, LL b ) {Matrix ans;ans.n = a.n;ans.m = a.m;for ( int i = 1;i <= ans.n;i ++ )ans.c[i][i] = 1;while ( b ) {if ( b & 1 )ans = ans * a;a = a * a;b >>= 1;}return ans;
}int main() {int n, m, k, cat, Cat;char opt;while ( ~ scanf ( "%d %d %d", &n, &m, &k ) ) {if ( ! n && ! m && ! k )return 0;memset ( A.c, 0, sizeof ( A.c ) );A.n = 1;A.m = n + 1;A.c[1][n + 1] = 1;Matrix ans;ans.n = n + 1;ans.m = n + 1;for ( int i = 1;i <= ans.n;i ++ )ans.c[i][i] = 1;for ( int i = 1;i <= k;i ++ ) {getchar();scanf ( "%c %d", &opt, &cat );if ( opt == 'g' )ans.c[ans.m][cat] ++;else if ( opt == 'e' ) {for ( int j = 1;j <= ans.n;j ++ )ans.c[j][cat] = 0;} else {scanf ( "%d", &Cat );for ( int j = 1;j <= ans.n;j ++ )swap ( ans.c[j][cat], ans.c[j][Cat] );}}ans = qkpow ( ans, m );A = A * ans;A.print();}return 0;
}

有任何问题欢迎提出,byebye
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/318021.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

你准备好了在云中工作吗?

前几天写了一篇文章 《云时代的.NET》&#xff0c;今天继续这个话题聊下云时代的技能。无服务器计算&#xff0c;容器化&#xff0c;云原生应用&#xff0c;DevOps&#xff0c;人工智能&#xff0c;机器学习以及混合云和多云解决方案等IT趋势正在成为主流或“新常态”。所有大小…

最长公共上升子序列(LCIS)

题意&#xff1a; 求最长公共上升子序列 题解&#xff1a; 最长公共上升子序列 最长公共子序列&#xff08;LCS&#xff09;与最长上升子序列&#xff08;LIS&#xff09; LCS核心代码&#xff1a; for(int i1;i<n;i){for(int j1;j<m;j){if(a[i]b[j])dp[i][j]max(dp[…

[高斯消元及理论]线性方程组整数/浮点数,模线性方程组,异或方程组模板

文章目录理论线性方程组整数类型解线性方程组浮点类型解模线性方程组异或方程组高斯约旦消元约旦消元无解无穷解唯一解理论 高斯消元法&#xff0c;是线性代数规划中的一个算法&#xff0c;可用来为线性方程组求解。但其算法十分复杂&#xff0c;不常用于加减消元法&#xff0c…

eShopOnContainers 知多少[7]:Basket microservice

引言Basket microservice&#xff08;购物车微服务&#xff09;主要用于处理购物车的业务逻辑&#xff0c;包括&#xff1a;购物车商品的CRUD订阅商品价格更新事件&#xff0c;进行购物车商品同步处理购物车结算事件发布订阅订单成功创建事件&#xff0c;进行购物车的清空操作架…

后缀数组 SA

后缀数组 SA 后缀树组(SA&#xff0c;suffix array)&#xff0c;用于处理字符串子串形成的结构。 处理子串的结构主要方式有&#xff1a;后缀数组 SA&#xff0c;后缀自动机 SAM&#xff0c;后缀树 ST。 后缀树和后缀自动机暂时决定咕咕咕&#xff0c;以后学习可以参考ix35 的字…

微软热门开源项目及代码库地址

点击蓝字关注我这几年来&#xff0c;微软在开源与社区方向的努力与成就是全世界有目共睹的。微软的开源项目超过2000多个&#xff0c;挑了一些比较火热的给大家整理了一下。欢迎补充~Visual Studio Code非常流行的跨平台代码编辑器&#xff0c;提供全面的编辑和调试支持、可扩展…

[树链剖分][SDOI 2011]染色,Housewife Wind

文章目录T1&#xff1a;Housewife Wind题目题解codeT2&#xff1a;染色题目题解code今天选择写这篇博客主要是为了告诉大家一个道理&#xff0c;数组比vectorvectorvector快太多了&#xff0c;我这两道题第一次都因为vectorvectorvector&#xff0c;TTT到飞起 T1&#xff1a;…

ASP.NET Core 网站运行时修改设置如何自动生效

点击蓝字关注我在ASP.NET Core中&#xff0c;如果修改了appsettings.json中的设置&#xff0c;那么默认情况下就得重启网站才能生效。有没有办法在修改设置后自动刷新并应用呢&#xff1f;背景首先&#xff0c;我们看看默认模板建出来的 ASP.NET Core 网站&#xff0c;配置文件…

1022. 宠物小精灵之收服

1022. 宠物小精灵之收服 题意&#xff1a; 现在有n个胶囊&#xff0c;m个生命值&#xff0c;k个怪物&#xff0c;每个怪物需要a[i]个胶囊&#xff0c;且会造成b[i]个伤害后才能捕获&#xff0c;问在活着的前提下&#xff0c;最多捕获多少怪物&#xff0c;在怪物最多的情况下剩…

【周末狂欢赛6】[AT1219]历史研究(回滚莫队),大魔法师(矩阵+线段树),单峰排列

文章目录T1&#xff1a;单峰排列题目题解codeT2&#xff1a;历史研究题目题解codeT3&#xff1a;大魔法师题目题解code我可能这辈子都更不出来狂欢赛5了&#xff0c;先咕咕 T1&#xff1a;单峰排列 题目 一个n的全排列A[i]是单峰的&#xff0c;当且仅当存在某个x使得A[1]<…

YBTOJ:圈套问题(分治法、鸽笼原理)

文章目录题目描述数据范围解析代码图片转载自&#xff1a; https://blog.csdn.net/weixin_43346722/article/details/118435430题目描述 平面上有 n个点&#xff0c;用n个大小相同的圆分别将一个点作为圆心&#xff0c;同时满足圆圈不相交&#xff0c;求圆的最大半径。 数据范…

ASP.NET Core 实战:使用 NLog 将日志信息记录到 MongoDB

一、前言在项目开发中&#xff0c;日志系统是系统的一个重要组成模块&#xff0c;通过在程序中记录运行日志、错误日志&#xff0c;可以让我们对于系统的运行情况做到很好的掌控。同时&#xff0c;收集日志不仅仅可以用于诊断排查错误&#xff0c;由于日志同样也是大量的数据&a…

[学习笔记] 伸展树splay详解+全套模板+例题[Luogu P3369 【模板】普通平衡树]

文章目录引入概念全套模板变量声明updaterotate旋转splay操作insert插入delete删除查找x的位置查找第k大前驱/后继极小值-inf和极大值inf的作用例题&#xff1a;P3369 【模板】普通平衡树题目code声明一下&#xff0c;许多代码的注解都在模板代码里面写了的&#xff0c;所以正文…

手写AspNetCore 认证授权代码

在普通的MVC项目中 我们普遍的使用Cookie来作为认证授权方式&#xff0c;使用简单。登录成功后将用户信息写入Cookie&#xff1b;但当我们做WebApi的时候显然Cookie这种方式就有点不适用了。在dotnet core 中 WebApi中目前比较流行的认证授权方式是Jwt (Json Web Token) 技术。…

YBTOJ:采矿战略(线段树维护dp、树链剖分)

文章目录题目描述解析代码题目描述 所谓线段树维护dp&#xff0c;就是在线段树上维护dp &#xff08;逃&#xff09; 解析 把树剖一下后就变成了区间问题 考虑建一棵线段树&#xff0c;每一个结点都是一个背包 这样就能区间查询&#xff0c;也能带修了 这种做法复杂度其实并不…

【用皇宫三十六计生存法则带你走进LCT(动态树)】LCT概念+模板+例题【洛谷P3690 Link Cut Tree(动态树)】

文章目录LCT概念模板rotatoisrootsplayaccessmakerootsplitfindrootlinkcut封装版例题题目code普通版code封装版这篇博客主要是帮助大家理解各个模板及LCTLCTLCT的意思&#xff0c;方便理解&#xff0c;模板写法的理解在代码里有注释详解&#xff0c;如果要看原理的话&#xff…

迈向现代化的 .Net 配置指北

1. 欢呼 .NET Standard 时代我现在已不大提 .Net Core&#xff0c;对于我来说&#xff0c;未来的开发将是基于 .NET Standard&#xff0c;不仅仅是 面向未来 &#xff0c;也是 面向过去&#xff1b;不只是 .Net Core 可以享受便利&#xff0c; .NET Framework 不升级一样能享受…

YBTOJ洛谷P2042:维护数列(平衡树)

文章目录题目描述解析删除区间插入数列修改&翻转区间和&最大子段和代码传送门题目描述 解析 阴间题… 这不是裸的板子吗&#xff1f; 国赛真的有人能把这题写出来吗… 应该算一道练习作用很强的题了 写完这题&#xff0c;各种平衡树维护区间操作的方法可以说是毕业了吧…

CAP 2.4版本发布,支持版本隔离特性

前言自从上次 CAP 2.3 版本发布 以来&#xff0c;已经过去了几个月的时间&#xff0c;这几个月比较忙&#xff0c;所以也没有怎么写博客&#xff0c;趁着2019年到来之际&#xff08;现在应该是2019年开始的时候&#xff09;&#xff0c;CAP也发布了2018年的最后一个大版本 2.4&…

【周末狂欢赛7】【NOIP模拟赛】七夕祭,齿轮(dfs),天才黑客

文章目录T1题目题解codeT2题目题解codeT3题目题解codeT1 题目 七夕节因牛郎织女的传说而被扣上了「情人节」的帽子。于是TYVJ今年举办了一次线下七夕祭。Vani同学今年成功邀请到了cl同学陪他来共度七夕&#xff0c;于是他们决定去TYVJ七夕祭游玩。 TYVJ七夕祭和11区的夏祭的…