結果

問題 No.2513 Power Eraser
ユーザー kotatsugamekotatsugame
提出日時 2023-10-20 23:16:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,234 bytes
コンパイル時間 745 ms
コンパイル使用メモリ 73,304 KB
実行使用メモリ 8,780 KB
最終ジャッジ日時 2023-10-20 23:17:11
合計ジャッジ時間 13,518 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,700 KB
testcase_01 AC 3 ms
4,684 KB
testcase_02 AC 3 ms
4,684 KB
testcase_03 AC 3 ms
4,688 KB
testcase_04 AC 28 ms
4,688 KB
testcase_05 AC 5 ms
4,688 KB
testcase_06 AC 46 ms
4,688 KB
testcase_07 AC 15 ms
4,688 KB
testcase_08 AC 42 ms
4,688 KB
testcase_09 AC 62 ms
4,688 KB
testcase_10 AC 36 ms
4,688 KB
testcase_11 AC 4 ms
4,688 KB
testcase_12 AC 24 ms
4,688 KB
testcase_13 AC 4,161 ms
4,688 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
7_evil_case_1.txt -- -
7_evil_case_2.txt -- -
7_evil_case_3.txt -- -
7_evil_case_4.txt -- -
7_evil_case_5.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cassert>
#include<atcoder/modint>
using namespace std;
#include<vector>
template<typename T>
struct combination{
	vector<T>fac,ifac;
	combination(size_t N=0):fac(1,1),ifac(1,1)
	{
		make_table(N);
	}
	void make_table(size_t N)
	{
		if(fac.size()>N)return;
		size_t now=fac.size();
		N=max(N,now*2);
		fac.resize(N+1);
		ifac.resize(N+1);
		for(size_t i=now;i<=N;i++)fac[i]=fac[i-1]*i;
		ifac[N]=1/fac[N];
		for(size_t i=N;i-->now;)ifac[i]=ifac[i+1]*(i+1);
	}
	T factorial(size_t n)
	{
		make_table(n);
		return fac[n];
	}
	T invfac(size_t n)
	{
		make_table(n);
		return ifac[n];
	}
	T P(size_t n,size_t k)
	{
		if(n<k)return 0;
		make_table(n);
		return fac[n]*ifac[n-k];
	}
	T C(size_t n,size_t k)
	{
		if(n<k)return 0;
		make_table(n);
		return fac[n]*ifac[n-k]*ifac[k];
	}
	T H(size_t n,size_t k)
	{
		if(n==0)return k==0?1:0;
		return C(n-1+k,k);
	}
};
using mint=atcoder::modint998244353;
combination<mint>C;
int N;
mint A[2<<17];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>N;
	for(int i=0;i<N;i++)
	{
		int a;cin>>a;
		A[i]=mint::raw(a);
	}
	mint ret=1;
	for(int i=0;i<N;i++)for(int j=i+1;j<N;j++)ret*=A[j]-A[i];
	if((long)N*(N-1)/2%2==1)ret=-ret;
	cout<<ret.val()<<endl;
}
0