結果
| 問題 | No.1958 Bit Game |
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2022-05-27 22:10:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 1,564 ms / 2,000 ms |
| コード長 | 551 bytes |
| 記録 | |
| コンパイル時間 | 368 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 126,492 KB |
| 最終ジャッジ日時 | 2026-04-09 02:15:20 |
| 合計ジャッジ時間 | 35,061 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
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
p, q = 1, 1
for j in range(n):
ans += p * pow(cy, n - j, MOD) * q * pow(x - cx, n - j - 1, MOD) * cx % MOD
p *= y
q *= x
p %= MOD
q %= MOD
res += ans << i
print(res % MOD)
hir355