結果

問題 No.1142 XOR と XOR
ユーザー yuruhiyayuruhiya
提出日時 2021-03-17 09:28:31
言語 Ruby
(3.3.0)
結果
AC  
実行時間 544 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 50,688 KB
最終ジャッジ日時 2024-04-25 16:47:48
合計ジャッジ時間 13,896 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 325 ms
17,024 KB
testcase_01 AC 330 ms
17,024 KB
testcase_02 AC 329 ms
16,896 KB
testcase_03 AC 533 ms
50,688 KB
testcase_04 AC 501 ms
44,928 KB
testcase_05 AC 454 ms
40,832 KB
testcase_06 AC 507 ms
45,952 KB
testcase_07 AC 531 ms
50,304 KB
testcase_08 AC 537 ms
50,560 KB
testcase_09 AC 537 ms
50,560 KB
testcase_10 AC 544 ms
50,688 KB
testcase_11 AC 328 ms
17,024 KB
testcase_12 AC 333 ms
17,024 KB
testcase_13 AC 331 ms
17,024 KB
testcase_14 AC 438 ms
37,632 KB
testcase_15 AC 432 ms
37,376 KB
testcase_16 AC 338 ms
23,552 KB
testcase_17 AC 474 ms
41,216 KB
testcase_18 AC 366 ms
27,264 KB
testcase_19 AC 507 ms
45,440 KB
testcase_20 AC 435 ms
37,248 KB
testcase_21 AC 394 ms
31,744 KB
testcase_22 AC 371 ms
27,392 KB
testcase_23 AC 476 ms
41,600 KB
testcase_24 AC 516 ms
46,720 KB
testcase_25 AC 430 ms
36,608 KB
testcase_26 AC 508 ms
45,568 KB
testcase_27 AC 452 ms
40,576 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

(*,k),x,y=$<.map{_1.split.map &:to_i}
x,y=[x,y].map{|a|c=[1]+(t=[x=0]*M=1024)
a.map{c[x^=_1]+=1}
M.times.map{|i|i.times.map{t[i^_1]+=c[i]*c[_1]};t[0]+=c[i]*~-c[i]/2}
t}
p M.times.sum{x[_1]*y[_1^k]}.%10**9+7
0