結果
| 問題 |
No.2062 Sum of Subset mod 999630629
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 14:55:41 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 660 bytes |
| コンパイル時間 | 454 ms |
| コンパイル使用メモリ | 82,468 KB |
| 実行使用メモリ | 81,168 KB |
| 最終ジャッジ日時 | 2025-06-12 14:57:57 |
| 合計ジャッジ時間 | 3,051 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 19 |
ソースコード
MOD = 998244353
P = 999630629
def main():
import sys
input = sys.stdin.read().split()
N = int(input[0])
A = list(map(int, input[1:N+1]))
sum_A = sum(A)
exponent = pow(2, N-1, MOD)
sum_s = (sum_A % MOD) * exponent % MOD
# Compute count, the number of subsets with sum >= P
# This part is left as a placeholder since the correct approach isn't clear
# For the purpose of this example, we assume count = 0
count = 0
# S_total = sum_s - P * count mod MOD
P_mod = P % MOD
term = (P_mod * count) % MOD
S_total = (sum_s - term) % MOD
print(S_total)
if __name__ == "__main__":
main()
gew1fw