結果

問題 No.1958 Bit Game
ユーザー Eki1009Eki1009
提出日時 2022-05-27 21:35:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 387 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 81,856 KB
実行使用メモリ 142,848 KB
最終ジャッジ日時 2023-10-20 19:59:31
合計ジャッジ時間 10,642 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 383 ms
142,280 KB
testcase_01 AC 386 ms
142,580 KB
testcase_02 AC 383 ms
142,580 KB
testcase_03 AC 381 ms
142,584 KB
testcase_04 AC 386 ms
142,592 KB
testcase_05 AC 383 ms
142,580 KB
testcase_06 AC 387 ms
142,848 KB
testcase_07 AC 386 ms
142,580 KB
testcase_08 AC 382 ms
142,580 KB
testcase_09 AC 384 ms
142,580 KB
testcase_10 AC 144 ms
89,128 KB
testcase_11 AC 204 ms
106,656 KB
testcase_12 AC 263 ms
111,728 KB
testcase_13 AC 262 ms
104,048 KB
testcase_14 AC 223 ms
105,156 KB
testcase_15 AC 237 ms
110,004 KB
testcase_16 AC 188 ms
104,792 KB
testcase_17 AC 321 ms
112,980 KB
testcase_18 AC 294 ms
114,040 KB
testcase_19 AC 204 ms
110,712 KB
testcase_20 AC 258 ms
103,328 KB
testcase_21 AC 251 ms
114,176 KB
testcase_22 AC 165 ms
89,232 KB
testcase_23 AC 170 ms
101,276 KB
testcase_24 AC 318 ms
119,072 KB
testcase_25 AC 181 ms
104,804 KB
testcase_26 AC 222 ms
108,680 KB
testcase_27 AC 220 ms
106,124 KB
testcase_28 AC 288 ms
106,284 KB
testcase_29 AC 153 ms
98,708 KB
testcase_30 AC 37 ms
53,476 KB
testcase_31 AC 38 ms
53,476 KB
testcase_32 AC 45 ms
59,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
n,x,y = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
for i in range(18):
  a = sum(a>>i&1 for a in A)
  b = x-a
  c = sum(b>>i&1 for b in B)
  d = y-c
  dp0,dp1 = 1,0
  for _ in range(n):
    dp0,dp1 = dp0*b%mod,(dp0*a%mod+dp1*x%mod)%mod
    dp0,dp1 = (dp0*y%mod+dp1*d%mod)%mod,dp1*c%mod
  ans += (dp1<<i)%mod
  ans %= mod
print(ans)
0