跳到正文

个人记录

1

原文
文章信息与版本

文章信息

收录
2026年4月25日
更新
2026年4月25日
篇幅
约 1 分钟

版本

  1. v2当前
  2. v1
C++
#include <bits/stdc++.h>
#define int long long
#define mod 998244353
using namespace std;
int n,m;
int a[5005][5005];
signed main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t,N;
	cin>>t>>N;
	int ans=0;
	a[0][0]=1;
    for(int i=1;i<=5000;i++){
		a[i][0]=1;
		for(int j=1;j<=i;j++){
			a[i][j]=(a[i-1][j]+a[i-1][j-1])%mod;
		}
	}
	while(t--){
		cin>>n>>m;
		ans^=(a[n][m]/a[m][m]);
	}
    cout<<ans<<endl;
	return 0;
}
原文