您当前的位置: 首页 > 

对方正在debug

暂无认证

  • 7浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Tyler and Strings(树状数组/排列组合/dp)

对方正在debug 发布时间:2022-03-12 16:45:59 ,浏览量:7

题目 题意:给定两个数组 s , t s,t s,t,现重排列数组 s s s,使得数组 s s s小于 t t t。问有多少种排列方式。

参考 代码源自cwxzh

#include
using namespace std;
#define ll long long
const ll mod=998244353;
ll n,m,a[202020],cnt,p[202020],ans,fac[202020],inv[202020],s[202020],invfac[202020];

// 树状数组 
ll lowbit(ll aa){
	return aa&-aa;
}
void add(ll pos,ll x){
	for(ll i=pos;i0;i-=lowbit(i)) res+=s[i];
	return res;
}

int main(){
	cin>>n>>m;
	for(int i=1;i>x;
		p[x]++;
		cnt=max(cnt,(ll)x);
	}
	for(int i=1;i>a[i];
	fac[0]=fac[1]=inv[0]=inv[1]=invfac[0]=invfac[1]=1;
	for(int i=2;i            
关注
打赏
1664895754
查看更多评论
0.0514s