結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 297 ms
16,640 KB
testcase_01 AC 302 ms
16,512 KB
testcase_02 AC 299 ms
16,512 KB
testcase_03 AC 508 ms
50,560 KB
testcase_04 AC 473 ms
44,544 KB
testcase_05 AC 415 ms
40,320 KB
testcase_06 AC 474 ms
45,184 KB
testcase_07 AC 503 ms
49,664 KB
testcase_08 AC 507 ms
50,304 KB
testcase_09 AC 507 ms
50,176 KB
testcase_10 AC 511 ms
50,176 KB
testcase_11 AC 299 ms
16,512 KB
testcase_12 AC 301 ms
16,512 KB
testcase_13 AC 299 ms
16,512 KB
testcase_14 AC 402 ms
37,120 KB
testcase_15 AC 402 ms
36,864 KB
testcase_16 AC 306 ms
23,168 KB
testcase_17 AC 437 ms
42,752 KB
testcase_18 AC 336 ms
26,752 KB
testcase_19 AC 474 ms
45,440 KB
testcase_20 AC 405 ms
36,992 KB
testcase_21 AC 363 ms
31,104 KB
testcase_22 AC 335 ms
27,136 KB
testcase_23 AC 447 ms
41,728 KB
testcase_24 AC 483 ms
46,208 KB
testcase_25 AC 402 ms
35,968 KB
testcase_26 AC 468 ms
45,056 KB
testcase_27 AC 422 ms
40,448 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}
(0...M).map{|i|(0...i).map{t[i^_1]+=c[i]*c[_1]};t[0]+=c[i]*~-c[i]/2}
t}
p (0...M).sum{x[_1]*y[_1^k[2]]}.%10**9+7
0