結果

問題 No.2197 Same Dish
ユーザー tailstails
提出日時 2023-01-20 21:45:22
言語 cLay
(20231016-1)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 185 bytes
コンパイル時間 6,190 ms
コンパイル使用メモリ 205,700 KB
実行使用メモリ 9,260 KB
最終ジャッジ日時 2023-09-05 13:59:40
合計ジャッジ時間 7,449 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 3 ms
4,376 KB
testcase_14 AC 10 ms
8,824 KB
testcase_15 AC 11 ms
8,988 KB
testcase_16 AC 8 ms
8,468 KB
testcase_17 AC 7 ms
5,912 KB
testcase_18 AC 11 ms
9,008 KB
testcase_19 AC 11 ms
9,260 KB
testcase_20 AC 12 ms
9,060 KB
testcase_21 AC 10 ms
9,192 KB
testcase_22 AC 13 ms
9,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define MD 998244353
ll@n,@k,a[2n],b=0;
Mint y=1,z;
rep(i,2n){
	ll@x;
	a[i]=x<<2|!(i&1);
}
sortA(2n,a);
rep[a](x,2n){
	if(x&1){
		z=z*k+y*b;
		y*=k-b;
		++b;
	}else{
		--b;
	}
}
wt(z);
0