// Problem: P3538 [POI2012]OKR-A Horrible Poem // Contest: Luogu // URL: https://www.luogu.com.cn/problem/P3538 // Memory Limit: 125 MB // Time Limit: 1000 ms // // Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h> usingnamespace std; #define int long long inlineintread(){int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+ (x<<3)+(ch^48);ch=getchar();}return x*f;} #define N 500010 //#define M #define mo 998244353 // #define mo 1000000009 structnode { int x, y, n; }d[N*4]; int n, m, i, j, k; int a[N], f[N], l, r; int len, h[N], b[N], g; char s[N];
inlineintMOD(int x) { return (x%mo+mo)%mo; }
inlineintqiu(int l, int r) { returnMOD(a[r]-a[l-1]*f[r-l+1]); }
voidcun(int x, int y) { d[++k].x=x; d[k].y=y; d[k].n=h[x]; h[x]=k; }