結果

問題 No.3826 PRiSM Net
コンテスト
ユーザー okkuu
提出日時 2026-11-20 19:54:41
言語 C++23(gnu拡張gcc16)
(gcc 16.2.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc16.so -lm -std=gnu++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 39 ms / 2,000 ms
+ 475µs
コード長 1,417 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,501 ms
コンパイル使用メモリ 492,988 KB
実行使用メモリ 11,244 KB
最終ジャッジ日時 2026-11-22 12:45:00
合計ジャッジ時間 9,369 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

//*
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//*/
#include<bits/extc++.h>
using namespace std;
//using namespace __gnu_cxx;
//using namespace __gnu_pbds;
//*
#include<atcoder/all>
using namespace atcoder;
using mint=modint998244353;
using Mint=modint1000000007;
//*/
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using P=pair<int,int>;
using Pl=pair<ll,ll>;
constexpr int mod=998244353;
constexpr int Mod=1e9+7;
constexpr int inf=Mod;
constexpr ll linf=(ll)inf*inf;
constexpr int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
constexpr int Dx[]={1,1,1,0,0,-1,-1,-1},Dy[]={1,0,-1,1,-1,1,0,-1};
struct initio{
	initio(){
		cin.tie(0)->sync_with_stdio(0);
		cout<<fixed<<setprecision(20);
	};
}iio;
template<class T>
bool chmax(T&a,const T&b){
	if(a<b){
		a=b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a,const T&b){
	if(a>b){
		a=b;
		return 1;
	}
	return 0;
}
int fl2(ll n){
	return 63-__builtin_clzll(n);
}
int main(){
	int t;
	cin>>t;
	int MX=1000000;
	vector<mint>fact(2*MX+1);
	fact[0]=1;
	for(int i=1;i<=2*MX;i++)
		fact[i]=i*fact[i-1];
	auto comb=[&](int n,int r)->mint{
		if(!(0<=r&&r<=n))
			return 0;
		return fact[n]/(fact[r]*fact[n-r]);
	};
	int n,k,l;
	while(cin>>n>>k>>l){
		mint ans;
		ans+=comb(n+k+l-2,2*k+2*l-3)*comb(k+l-2,k-1);
		ans+=2*comb(n+k+l-2,2*k+2*l-2)*comb(k+l-2,k-1);
		ans*=n;
		cout<<ans.val()<<endl;
	}
}
0