結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 332 ms
17,024 KB
testcase_01 AC 331 ms
17,152 KB
testcase_02 AC 332 ms
17,280 KB
testcase_03 AC 544 ms
50,816 KB
testcase_04 AC 504 ms
44,928 KB
testcase_05 AC 459 ms
40,704 KB
testcase_06 AC 511 ms
45,696 KB
testcase_07 AC 537 ms
50,304 KB
testcase_08 AC 539 ms
50,432 KB
testcase_09 AC 538 ms
50,688 KB
testcase_10 AC 541 ms
50,560 KB
testcase_11 AC 329 ms
17,152 KB
testcase_12 AC 333 ms
17,024 KB
testcase_13 AC 331 ms
17,280 KB
testcase_14 AC 437 ms
37,632 KB
testcase_15 AC 429 ms
37,248 KB
testcase_16 AC 339 ms
23,552 KB
testcase_17 AC 469 ms
41,216 KB
testcase_18 AC 365 ms
27,136 KB
testcase_19 AC 509 ms
45,696 KB
testcase_20 AC 430 ms
37,504 KB
testcase_21 AC 398 ms
31,488 KB
testcase_22 AC 367 ms
27,648 KB
testcase_23 AC 478 ms
41,600 KB
testcase_24 AC 522 ms
46,976 KB
testcase_25 AC 429 ms
36,480 KB
testcase_26 AC 504 ms
45,440 KB
testcase_27 AC 454 ms
40,704 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

(*,k),x,y=$<.map{_1.split.map &:to_i}
x,y=[x,y].map{|a|c=[1]+[x=0]*M=1024
a.map{c[x^=_1]+=1}
t=[0]*M
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