結果
| 問題 |
No.2062 Sum of Subset mod 999630629
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-16 16:04:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 565 bytes |
| コンパイル時間 | 203 ms |
| コンパイル使用メモリ | 81,840 KB |
| 実行使用メモリ | 81,024 KB |
| 最終ジャッジ日時 | 2025-04-16 16:11:08 |
| 合計ジャッジ時間 | 3,422 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 19 |
ソースコード
MOD1 = 999630629
MOD2 = 998244353
N = int(input())
A = list(map(int, input().split()))
sum_A = sum(A)
if sum_A < MOD1:
pow2 = pow(2, N-1, MOD2)
ans = (sum_A % MOD2) * pow2 % MOD2
else:
# This part is not feasible to compute for large N and sum_A >= MOD1
# The code here is a placeholder and would not work for such cases
pow2 = pow(2, N-1, MOD2)
total_subsets = (pow(2, N, MOD2) - 1) % MOD2
# Assuming count_ge is 0 for demonstration (incorrect in general)
count_ge = 0
ans = (sum_A * pow2 - MOD1 * count_ge) % MOD2
print(ans)
lam6er