結果

問題 No.1142 XOR と XOR
ユーザー yuruhiyayuruhiya
提出日時 2020-08-01 20:19:05
言語 Ruby
(3.3.0)
結果
AC  
実行時間 414 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 33,920 KB
最終ジャッジ日時 2024-04-25 16:37:40
合計ジャッジ時間 10,558 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 229 ms
12,160 KB
testcase_01 AC 230 ms
12,288 KB
testcase_02 AC 230 ms
12,416 KB
testcase_03 AC 409 ms
33,536 KB
testcase_04 AC 390 ms
32,128 KB
testcase_05 AC 343 ms
28,416 KB
testcase_06 AC 386 ms
30,976 KB
testcase_07 AC 414 ms
32,368 KB
testcase_08 AC 410 ms
33,276 KB
testcase_09 AC 404 ms
33,116 KB
testcase_10 AC 410 ms
33,372 KB
testcase_11 AC 227 ms
12,160 KB
testcase_12 AC 235 ms
12,288 KB
testcase_13 AC 227 ms
12,416 KB
testcase_14 AC 327 ms
23,256 KB
testcase_15 AC 327 ms
25,984 KB
testcase_16 AC 250 ms
12,544 KB
testcase_17 AC 347 ms
30,720 KB
testcase_18 AC 257 ms
16,000 KB
testcase_19 AC 387 ms
31,104 KB
testcase_20 AC 335 ms
25,216 KB
testcase_21 AC 288 ms
19,584 KB
testcase_22 AC 266 ms
15,616 KB
testcase_23 AC 359 ms
31,232 KB
testcase_24 AC 391 ms
31,488 KB
testcase_25 AC 314 ms
22,656 KB
testcase_26 AC 395 ms
33,920 KB
testcase_27 AC 346 ms
28,928 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:11: warning: assigned but unused variable - n
Main.rb:11: warning: assigned but unused variable - m
Syntax OK

ソースコード

diff #

def r
gets.split.map &:to_i
end
M=1024
s=->a{c=[1]+[x=0]*M
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}
n,m,k=r
a=r
b=r
x=s[a]
y=s[b]
p (0...M).sum{x[_1]*y[_1^k]}.%10**9+7
0