結果
| 問題 |
No.1958 Bit Game
|
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2022-05-27 22:03:51 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 514 bytes |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 82,560 KB |
| 実行使用メモリ | 153,992 KB |
| 最終ジャッジ日時 | 2024-09-20 15:55:55 |
| 合計ジャッジ時間 | 7,257 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):
if cx > 0:
ans += pow(y, j, MOD) * pow(cy, n - j, MOD) * pow(x, j, MOD) * pow(x - cx, n - j - 1, MOD) * cx
res += ans << i
print(res % MOD)
hir355