結果

問題 No.1891 Static Xor Range Composite Query
ユーザー tailstails
提出日時 2022-04-04 19:16:17
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 589 bytes
コンパイル時間 3,841 ms
コンパイル使用メモリ 178,116 KB
実行使用メモリ 44,416 KB
最終ジャッジ日時 2024-05-04 04:43:27
合計ジャッジ時間 9,935 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
42,368 KB
testcase_01 AC 49 ms
42,368 KB
testcase_02 AC 48 ms
42,240 KB
testcase_03 AC 47 ms
42,368 KB
testcase_04 AC 52 ms
42,368 KB
testcase_05 AC 73 ms
42,368 KB
testcase_06 AC 48 ms
42,368 KB
testcase_07 AC 49 ms
42,240 KB
testcase_08 AC 51 ms
42,240 KB
testcase_09 AC 50 ms
42,368 KB
testcase_10 AC 50 ms
42,368 KB
testcase_11 AC 50 ms
42,496 KB
testcase_12 AC 50 ms
42,496 KB
testcase_13 AC 49 ms
42,496 KB
testcase_14 AC 48 ms
42,496 KB
testcase_15 AC 48 ms
42,368 KB
testcase_16 AC 51 ms
42,496 KB
testcase_17 AC 51 ms
42,624 KB
testcase_18 AC 51 ms
42,496 KB
testcase_19 AC 50 ms
42,368 KB
testcase_20 AC 49 ms
42,368 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define MD 998244353

struct AB {
	Mint a,b;
};

AB operator*(AB x,AB y){
	return {y.a*x.a,y.a*x.b+y.b};
}

AB ab[19][262144];

AB f(ll l,ll p){
	AB x{1,0};
	if(l==0){
		x=ab[17][p];
	}else{
		for(ll d=0;d<18;++d){
			if(l&1<<d){
				x=x*ab[d][l^p];
				l+=1<<d;
			}
		}
	}
	return x;
}

{
	ll@n,@q;
	rep(i,n){
		rd(ab[0][i].a,ab[0][i].b);
	}
	rep(i,n,262144){
		ab[0][i]=AB{1,0};
	}
	rep(d,1,18){
		ll m=1<<d-1;
		rep(i,262144){
			ab[d][i]=ab[d-1][i]*ab[d-1][i^m];
		}
	}
	rep(q){
		ll@l,@r,@p,@x;
		AB u=f(l,p);
		AB v=f(r,p);
		u.b-=v.b;
		u.a/=v.a;
		u.b/=v.a;
		wt(u.a*x+u.b);
	}
}
0