結果

問題 No.1240 Or Sum of Xor Pair
ユーザー 👑 NachiaNachia
提出日時 2020-12-13 18:46:13
言語 cLay
(20231016-1)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 1,835 ms
コンパイル使用メモリ 163,148 KB
実行使用メモリ 44,496 KB
最終ジャッジ日時 2023-09-19 01:55:27
合計ジャッジ時間 7,833 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
44,340 KB
testcase_01 AC 110 ms
44,264 KB
testcase_02 AC 116 ms
44,236 KB
testcase_03 AC 86 ms
44,308 KB
testcase_04 AC 96 ms
44,304 KB
testcase_05 AC 120 ms
44,268 KB
testcase_06 AC 90 ms
44,248 KB
testcase_07 AC 88 ms
44,496 KB
testcase_08 AC 87 ms
44,300 KB
testcase_09 AC 84 ms
44,296 KB
testcase_10 AC 110 ms
44,256 KB
testcase_11 AC 91 ms
44,304 KB
testcase_12 AC 112 ms
44,304 KB
testcase_13 AC 117 ms
44,292 KB
testcase_14 AC 94 ms
44,388 KB
testcase_15 AC 145 ms
44,300 KB
testcase_16 AC 132 ms
44,296 KB
testcase_17 AC 121 ms
44,320 KB
testcase_18 AC 132 ms
44,308 KB
testcase_19 AC 122 ms
44,248 KB
testcase_20 AC 144 ms
44,456 KB
testcase_21 AC 139 ms
44,392 KB
testcase_22 AC 135 ms
44,292 KB
testcase_23 AC 120 ms
44,316 KB
testcase_24 AC 135 ms
44,264 KB
testcase_25 AC 112 ms
44,324 KB
testcase_26 AC 141 ms
44,312 KB
testcase_27 AC 120 ms
44,264 KB
testcase_28 AC 117 ms
44,280 KB
testcase_29 AC 111 ms
44,332 KB
testcase_30 AC 122 ms
44,236 KB
testcase_31 AC 123 ms
44,280 KB
testcase_32 AC 110 ms
44,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll N,X,C[1<<18][19],z[18]={},D,x,Z=0,a,i;
{
    rd(N,X);
	rep(i,N){
		rd(a);
		rep(j,18)if(!(a&1<<j))C[a][j]++;
		C[a][18]++;
	}
	rep(d,19){
		D=1<<d;
		if(X&D){
			x=(X-D)&~(D-1);
			rep(i,0,1<<18,D)rep(j,18)z[j]+=C[i][18]*C[i^x][18]-C[i][j]*C[i^x][j];
		}
		rep(i,1<<18)if(i&D)rep(j,19)C[i-D][j]+=C[i][j];
	}
	rep(i,18)Z+=((z[i]-N+C[0][i])/2)<<i;
	wt(Z);
}
0