結果

問題 No.1142 XOR と XOR
ユーザー yuruhiyayuruhiya
提出日時 2020-08-01 20:26:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 472 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 39,168 KB
最終ジャッジ日時 2024-04-25 16:40:01
合計ジャッジ時間 12,109 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 288 ms
16,768 KB
testcase_01 AC 278 ms
16,512 KB
testcase_02 AC 286 ms
16,512 KB
testcase_03 AC 472 ms
39,168 KB
testcase_04 AC 432 ms
37,504 KB
testcase_05 AC 395 ms
33,280 KB
testcase_06 AC 429 ms
35,328 KB
testcase_07 AC 461 ms
37,248 KB
testcase_08 AC 450 ms
38,016 KB
testcase_09 AC 465 ms
37,888 KB
testcase_10 AC 449 ms
37,888 KB
testcase_11 AC 278 ms
16,640 KB
testcase_12 AC 283 ms
16,384 KB
testcase_13 AC 280 ms
16,512 KB
testcase_14 AC 382 ms
29,388 KB
testcase_15 AC 379 ms
31,104 KB
testcase_16 AC 283 ms
21,504 KB
testcase_17 AC 408 ms
33,920 KB
testcase_18 AC 324 ms
21,120 KB
testcase_19 AC 446 ms
35,712 KB
testcase_20 AC 387 ms
30,976 KB
testcase_21 AC 343 ms
25,216 KB
testcase_22 AC 320 ms
20,736 KB
testcase_23 AC 420 ms
34,432 KB
testcase_24 AC 436 ms
35,584 KB
testcase_25 AC 372 ms
28,416 KB
testcase_26 AC 441 ms
36,992 KB
testcase_27 AC 402 ms
33,920 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def r
gets.split.map &:to_i
end
s=->a{c=[1]+[x=0]*M=1024
a.map{c[x^=_1]+=1}
t=[0]*M
(0...M).map{|i|(0...i).map{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