Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
37787 | LYLAKIOI | 【S】T4 | C++ | 运行超时 | 95 | 1248 MS | 252 KB | 1089 | 2025-05-11 13:22:32 |
#include<bits/stdc++.h> #define up(i,l,r) for(int i=(l);i<=(r);++i) #define down(i,l,r) for(int i=(l);i>=(r);--i) #define pi pair<int,int> #define p1 first #define p2 second #define m_p make_pair #define p_b push_back using namespace std; typedef long long ll; const int maxn=5e5+10,mod=998244353; inline ll read(){ ll x=0;short t=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')t=-1;ch=getchar();} while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar(); return x*t; } int qp(int a,int b){ int res=1; while(b){ if(b&1)res=res*1ll*a%mod; a=a*1ll*a%mod;b>>=1; }return res; } int sol(int a,int b,int c){ int res=1; up(i,1-a,b-1)res=res*1ll*qp(a+c+i,min(i+a,b)-max(i+1,1)+1)%mod; up(i,2,a+b)res=res*1ll*qp(qp(a+b-i+1,min(i-1,b)-max(i-a,1)+1),mod-2)%mod; return res; } void slv(){ int n=read(),m=read(),k=read(); int res=(sol(n,m,k)-sol(n,m,k-1)+mod)%mod; cout<<res; } int main(){ //freopen("mountain.in","r",stdin),freopen("mountain.out","w",stdout); slv(); return 0; }