結果

問題 No.1142 XOR と XOR
ユーザー yuruhiyayuruhiya
提出日時 2021-03-17 15:18:41
言語 Ruby
(3.3.0)
結果
AC  
実行時間 504 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 50,560 KB
最終ジャッジ日時 2024-04-25 16:48:01
合計ジャッジ時間 12,746 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
16,512 KB
testcase_01 AC 291 ms
16,768 KB
testcase_02 AC 292 ms
16,512 KB
testcase_03 AC 499 ms
50,560 KB
testcase_04 AC 463 ms
44,416 KB
testcase_05 AC 411 ms
40,576 KB
testcase_06 AC 470 ms
45,440 KB
testcase_07 AC 491 ms
49,664 KB
testcase_08 AC 497 ms
50,048 KB
testcase_09 AC 500 ms
50,304 KB
testcase_10 AC 504 ms
50,304 KB
testcase_11 AC 291 ms
16,512 KB
testcase_12 AC 287 ms
16,768 KB
testcase_13 AC 291 ms
16,512 KB
testcase_14 AC 397 ms
36,992 KB
testcase_15 AC 392 ms
37,120 KB
testcase_16 AC 300 ms
23,168 KB
testcase_17 AC 427 ms
42,624 KB
testcase_18 AC 326 ms
26,880 KB
testcase_19 AC 465 ms
45,312 KB
testcase_20 AC 394 ms
36,864 KB
testcase_21 AC 354 ms
31,104 KB
testcase_22 AC 328 ms
27,136 KB
testcase_23 AC 436 ms
41,856 KB
testcase_24 AC 474 ms
46,208 KB
testcase_25 AC 389 ms
36,096 KB
testcase_26 AC 466 ms
45,056 KB
testcase_27 AC 414 ms
40,192 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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