結果

問題 No.1958 Bit Game
ユーザー lilictakalilictaka
提出日時 2022-06-02 00:15:16
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 608 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 308,636 KB
最終ジャッジ日時 2023-10-21 01:01:50
合計ジャッジ時間 7,832 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 AC 222 ms
129,308 KB
testcase_11 AC 689 ms
278,856 KB
testcase_12 AC 970 ms
273,580 KB
testcase_13 AC 759 ms
301,652 KB
testcase_14 AC 893 ms
289,488 KB
testcase_15 AC 545 ms
133,512 KB
testcase_16 AC 254 ms
103,964 KB
testcase_17 TLE -
testcase_18 AC 1,763 ms
284,552 KB
testcase_19 AC 457 ms
132,032 KB
testcase_20 AC 1,030 ms
308,636 KB
testcase_21 AC 901 ms
219,644 KB
testcase_22 AC 389 ms
224,276 KB
testcase_23 AC 173 ms
101,544 KB
testcase_24 TLE -
testcase_25 AC 319 ms
139,236 KB
testcase_26 AC 696 ms
304,696 KB
testcase_27 AC 443 ms
106,352 KB
testcase_28 AC 1,731 ms
295,636 KB
testcase_29 AC 354 ms
194,144 KB
testcase_30 AC 35 ms
53,580 KB
testcase_31 AC 35 ms
53,580 KB
testcase_32 AC 44 ms
62,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
mod = 998244353
ans = 0
for k in range(18):
    x = 0
    y = 0
    for a in A:
        if (a >> k) & 1:
            x += 1
    for b in B:
        if (b >> k) & 1:
            y += 1
    dp = [[0] * (2) for _ in range(N+1)]
    dp[0][0] = 1
    for n in range(1,N+1):
        dp[n][1] = dp[n-1][0] * x * y + dp[n-1][1] * X * y
        dp[n][1] %= mod
        dp[n][0] = dp[n-1][0] * (X*Y-x*y) + dp[n-1][1] * (X * (Y-y))
        dp[n][0] %= mod
    ans += dp[N][1] * pow(2,k,mod)
    ans %= mod
print(ans)
0