結果

問題 No.1142 XOR と XOR
ユーザー yuruhiyayuruhiya
提出日時 2020-08-01 20:23:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 437 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 32,256 KB
最終ジャッジ日時 2024-04-25 16:38:44
合計ジャッジ時間 11,240 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 246 ms
12,160 KB
testcase_01 AC 244 ms
12,288 KB
testcase_02 AC 242 ms
12,160 KB
testcase_03 AC 435 ms
32,256 KB
testcase_04 AC 405 ms
30,976 KB
testcase_05 AC 359 ms
27,392 KB
testcase_06 AC 403 ms
29,952 KB
testcase_07 AC 427 ms
30,840 KB
testcase_08 AC 436 ms
31,720 KB
testcase_09 AC 435 ms
31,600 KB
testcase_10 AC 437 ms
31,840 KB
testcase_11 AC 246 ms
12,160 KB
testcase_12 AC 246 ms
12,160 KB
testcase_13 AC 243 ms
12,288 KB
testcase_14 AC 358 ms
23,284 KB
testcase_15 AC 340 ms
25,216 KB
testcase_16 AC 251 ms
12,672 KB
testcase_17 AC 381 ms
29,312 KB
testcase_18 AC 277 ms
15,360 KB
testcase_19 AC 406 ms
30,464 KB
testcase_20 AC 349 ms
24,704 KB
testcase_21 AC 305 ms
19,200 KB
testcase_22 AC 287 ms
15,360 KB
testcase_23 AC 385 ms
30,976 KB
testcase_24 AC 405 ms
30,208 KB
testcase_25 AC 335 ms
22,528 KB
testcase_26 AC 407 ms
31,488 KB
testcase_27 AC 365 ms
27,776 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def r
gets.split.map &:to_i
end
s=->a{c=[1]+[x=0]*M=1024
a.each{c[x^=_1]+=1}
t=[0]*M
(0...M).each{|i|(0...i).each{t[i^_1]+=c[i]*c[_1]}
t[0]+=c[i]*~-c[i]/2}
t}
*,k=r
x=s[r]
y=s[r]
p (0...M).sum{x[_1]*y[_1^k]}.%10**9+7
0