結果

問題 No.2062 Sum of Subset mod 999630629
コンテスト
ユーザー gew1fw
提出日時 2025-06-12 20:21:45
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 660 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 235 ms
コンパイル使用メモリ 95,720 KB
実行使用メモリ 98,560 KB
最終ジャッジ日時 2026-07-12 00:21:31
合計ジャッジ時間 4,363 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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()
0