。
我没有失去任何东西,因为我一无所有。
Red panda dev c++ | ikuuu | 神秘画图网站 | 生成树 | 计数器 | 一言
cpp
传统
#include<bits/stdc++.h>
using namespace std;
#define debug(x,y) cout<<"Debug "<<x<<'='<<y<<'\n';
#define int long long
#define PII pair<int,int>
#define fi first
#define se second
signed main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
return 0;
}火车头
#include<bits/stdc++.h>
using namespace std;
#define couf(x,y) cout<<fixed<<setprecision(y)<<x;
#define debug(s,x) cerr<<s<<'='<<x<<'\n';
#define fop(i,l,r) for(int i=l;i<=r;i++)
#define foo(i,l,r) for(int i=r;i>=l;i--)
#define ull unsigned long long
#define int long long
#define PII pair<int,int>
#define pqueue priority_queue
#define mid(l,r) ((l+r)/2)
#define se second
#define fi first
#define llinf 1e37
#define dbinf 1e18
#define ecp 1e-15
#define inf 4e18
const int mod=998244353;
//fast-OI
template<typename T>inline void rd(T &x){
x=0;char c=getchar();bool f=0;
while(!isdigit(c))f|=c=='-',c=getchar();
while(isdigit(c))x=x*10+(c^48),c=getchar();
if(f)x=-x;
}template<typename T>inline void wt(T x){
if(x<0) putchar('-'),x=-x;
if(x>9) wt(x/10);
putchar(x%10+'0');
}template<typename T>inline void wln(T x){wt(x);putchar('\n');}
template<typename T>inline void wsp(T x){wt(x);putchar(' ');}
//math
inline int gcd(int a,int b){
while(b)a%=b,swap(a,b);
return a;
}inline int lcm(int a,int b){
return a/gcd(a,b)*b;
}inline int qpow(int a,int b,int mod){
int res=1;a%=mod;
for(;b;b>>=1){
if(b&1)res=res*a%mod;
a=a*a%mod;
}return res;
}inline int dpow(double a,int b){
double res=1;for(;b;b>>=1){
if(b&1)res=res*a;
a=a*a;
}return res;
}inline int mul(int a,int b,int mod){
int res=0; a%=mod;
while(b){
if(b&1) res=(res+a)%mod;
a=(a+a)%mod;b>>=1;
}return res;
}inline double sqpow(int x,int y){
double l=0,r=dbinf,res;while(r-l>ecp){
if(dpow(mid(l,r),y)<=x)res=mid(l,r),l=mid(l,r);
else r=mid(l,r);
}return res;
}inline int bsgs(int a,int b,int mod){
map<int,int>mp;a%=mod,b%=mod;
if(b==1)return 0;
int t=sqrt(mod)+1,aj=1;
fop(j,0,t-1){
if(!mp.count(b*aj%mod)) mp[b*aj%mod]=j;
aj=aj*a%mod;
}int at=qpow(a,t,mod),ai=1;fop(i,1,t){
ai=ai*at%mod;
if(mp.count(ai))return i*t-mp[ai];
}return -1;
}struct cob{
vector<int>fac,ifac;cob(int n){
fac.resize(n+1);ifac.resize(n+1);
fac[0]=1;fop(i,1,n)fac[i]=fac[i-1]*i%mod;
ifac[n]=qpow(fac[n],mod-2,mod);
foo(i,0,n-1)ifac[i]=ifac[i+1]*(i+1)%mod;
}int C(int n,int m){
if(n<0||m<0||n<m)return 0;
return fac[n]*ifac[m]%mod*ifac[n-m]%mod;
}int A(int n,int m){
if(n<0||m<0||n<m)return 0;
return fac[n]*ifac[n-m]%mod;
}
};
//rand
char rn_temp;
mt19937 rng(reinterpret_cast<uint64_t>(&rn_temp));
int rand(int l,int r){return l+rng()%(r-l);}
double rand_double(int l,int r){return uniform_real_distribution<double>(l,r)(rng);}
//hash
struct Hash{//自然溢出
vector<ull>h,pw;
ull base;Hash(string s,ull b=131):base(b){
int n=s.size();
h.resize(n+1,0); pw.resize(n+1,1);
fop(i,1,n){
h[i]=h[i-1]*base+s[i-1];
pw[i]=pw[i-1]*base;
}
}ull get(int l,int r){
return h[r]-h[l-1]*pw[r-l+1];
}
};
//
signed main(){
// ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); //与 rd&wt 冲突
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
return 0;
}/*「Rain」What am I waiting for?
*/- update 2026.8.12 整理
- update 2026.8.31 添加计数器&整理