結果

問題 No.2428 Returning Shuffle
ユーザー tailstails
提出日時 2023-08-18 22:07:40
言語 cLay
(20240104-1)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 8,060 ms
コンパイル使用メモリ 227,456 KB
実行使用メモリ 18,960 KB
最終ジャッジ日時 2023-08-18 22:07:51
合計ジャッジ時間 10,323 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
18,960 KB
testcase_01 AC 66 ms
18,792 KB
testcase_02 AC 79 ms
18,744 KB
testcase_03 AC 10 ms
10,456 KB
testcase_04 AC 9 ms
10,588 KB
testcase_05 AC 9 ms
10,632 KB
testcase_06 AC 9 ms
10,548 KB
testcase_07 AC 9 ms
10,612 KB
testcase_08 AC 9 ms
10,476 KB
testcase_09 AC 10 ms
10,512 KB
testcase_10 AC 10 ms
10,492 KB
testcase_11 AC 10 ms
10,524 KB
testcase_12 AC 9 ms
10,480 KB
testcase_13 AC 9 ms
10,512 KB
testcase_14 AC 10 ms
10,656 KB
testcase_15 AC 9 ms
10,504 KB
testcase_16 AC 9 ms
10,460 KB
testcase_17 AC 9 ms
10,556 KB
testcase_18 AC 9 ms
10,756 KB
testcase_19 AC 66 ms
18,728 KB
testcase_20 AC 65 ms
18,720 KB
testcase_21 AC 9 ms
10,504 KB
testcase_22 AC 10 ms
10,584 KB
testcase_23 AC 9 ms
10,480 KB
testcase_24 AC 68 ms
18,704 KB
testcase_25 AC 70 ms
18,712 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;
}
map<ll,ll>y;
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;
		}
		ll u[1d5],v[1d5];
		REP(k,Factor(a,u,v)){
			y[u[k]]>?=v[k];
		}
	}
}
Mint z=1;
for(auto w:y){
	z*=Mint(w.first)**w.second;
}
wt(z);
0