結果

問題 No.2445 奇行列式
ユーザー tailstails
提出日時 2023-08-25 22:45:13
言語 cLay
(20240104-1)
結果
AC  
実行時間 385 ms / 3,000 ms
コード長 287 bytes
コンパイル時間 2,193 ms
コンパイル使用メモリ 164,096 KB
実行使用メモリ 11,668 KB
最終ジャッジ日時 2023-08-25 22:45:19
合計ジャッジ時間 5,510 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 10 ms
4,376 KB
testcase_12 AC 41 ms
4,396 KB
testcase_13 AC 175 ms
7,504 KB
testcase_14 AC 385 ms
11,600 KB
testcase_15 AC 373 ms
11,552 KB
testcase_16 AC 370 ms
11,668 KB
testcase_17 AC 385 ms
11,564 KB
testcase_18 AC 367 ms
11,548 KB
testcase_19 AC 373 ms
11,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@b,@a[n][n];
modint().setmod(b);
modint d[1<<n][2];
d[0][0]=1;
d[0][1]=0;
rep(i,1<<n){
	ll c=__builtin_popcount(i);
	rep(j,n){
		if(!(i&1<<j)){
			ll p=__builtin_parity(i&-(1<<j));
			d[i|1<<j][0^p]+=d[i][0]*a[c][j];
			d[i|1<<j][1^p]+=d[i][1]*a[c][j];
		}
	}
}
wt(d[(1<<n)-1][1]);
0