csdn不支持align,我也不想再重新打一遍了
就直接贴个链接
链接:https://pan.baidu.com/s/1DL4JCpNogKXV5CcYbEKGdQ
提取码:rnyz
这是我按照题解的思路一边推一边写的,写完后感觉有了很深的理解
感觉推导只需要稍微了解一下和式就能理解,大家也可以自己手推一遍
#include <cstdio>
using namespace std;
#define dd c=getchar()
int read() {
int s=0,w=1;char c;while (dd,c>'9' || c<'0') if (c=='-') w=-1;while (c>='0' && c<='9') s=s*10+c-'0',dd;return s*w;}
#undef dd
const int P = 998244353,inv2=499122177,inv6=166374059;
struct node {
int f,g,h;
};
void Ad(int &x, int y) {
x