結果

問題 No.2206 Popcount Sum 2
ユーザー tailstails
提出日時 2023-02-06 10:54:24
言語 cLay
(20240104-1)
結果
AC  
実行時間 2,911 ms / 4,000 ms
コード長 387 bytes
コンパイル時間 7,424 ms
コンパイル使用メモリ 215,864 KB
実行使用メモリ 22,732 KB
最終ジャッジ日時 2023-09-17 22:38:18
合計ジャッジ時間 48,391 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 139 ms
5,688 KB
testcase_03 AC 146 ms
5,636 KB
testcase_04 AC 147 ms
5,616 KB
testcase_05 AC 2,899 ms
22,680 KB
testcase_06 AC 2,911 ms
22,496 KB
testcase_07 AC 2,894 ms
22,500 KB
testcase_08 AC 2,896 ms
22,540 KB
testcase_09 AC 2,887 ms
22,660 KB
testcase_10 AC 2,703 ms
22,512 KB
testcase_11 AC 2,701 ms
22,512 KB
testcase_12 AC 2,728 ms
22,600 KB
testcase_13 AC 2,564 ms
22,660 KB
testcase_14 AC 2,567 ms
22,556 KB
testcase_15 AC 2,588 ms
22,732 KB
testcase_16 AC 1,920 ms
22,680 KB
testcase_17 AC 1,917 ms
22,616 KB
testcase_18 AC 1,915 ms
22,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define MD 998244353

Comb<Mint>h;

ll@t,n[t],m[],o[],a[],r[];
rd((n,m)(t));
rep(i,t)o[i]=n[i]/450;
sortA_index(t,o,m,n,a);

ll b=0,c=0;
Mint z=1;

rep(i,t){
	ll e=n[i]-1;
	ll f=m[i]-1;
	if(f<c){
		z=1;
		c=0;
		b=e;
	}
	while(b<e){
		z=z*2-h.C(b,c);
		++b;
	}
	while(b>e){
		--b;
		z=(z+h.C(b,c))/2;
	}
	while(c<f){
		++c;
		z+=h.C(b,c);
	}
	r[a[i]]=z*(Mint(2)**(b+1)-1);
}
wtLn(r(t));
0