結果
問題 |
No.1958 Bit Game
|
ユーザー |
![]() |
提出日時 | 2022-05-27 22:04:39 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 497 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 154,628 KB |
最終ジャッジ日時 | 2024-09-20 15:56:05 |
合計ジャッジ時間 | 7,106 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 29 |
ソースコード
MOD = 998244353 n, x, y = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) res = 0 for i in range(18): ans = 0 cx = 0 for j in range(x): if (a[j] >> i) & 1: cx += 1 cy = 0 for j in range(y): if (b[j] >> i) & 1: cy += 1 for j in range(n): ans += pow(y, j, MOD) * pow(cy, n - j, MOD) * pow(x, j, MOD) * pow(x - cx, n - j - 1, MOD) * cx % MOD res += ans << i print(res % MOD)