結果

問題 No.2428 Returning Shuffle
ユーザー tailstails
提出日時 2023-08-18 21:59:23
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 324 bytes
コンパイル時間 3,326 ms
コンパイル使用メモリ 174,228 KB
実行使用メモリ 12,440 KB
最終ジャッジ日時 2023-08-18 21:59:31
合計ジャッジ時間 5,436 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,384 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,384 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,384 KB
testcase_24 AC 58 ms
12,192 KB
testcase_25 AC 55 ms
12,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define MD 998244353
ll@n++,@m;
ll p[n];
rep(i,n)p[i]=i;
rep(m){
	ll@t,@a,o=p[a];
	rep(t-1){
		ll@b;
		(o,p[b])=(p[b],o);
	}
	p[a]=o;
}
ll g=0,c=0;
Mint z=1;
rep(i,n){
	if(p[i]>=0&&p[i]!=i){
		ll j=i,a=0;
		while(p[j]>=0){
			(p[j],j)=(-1,p[j]);
			++a;
		}
		g=gcd(g,a);
		z*=a;
		++c;
	}
}
wt(c?z/Mint(g)**(c-1):Mint(1));
0