結果

問題 No.1336 Union on Blackboard
コンテスト
ユーザー 👑 terry_u16
提出日時 2021-01-15 21:57:08
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 448 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 68 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 64,572 KB
最終ジャッジ日時 2026-09-30 10:01:59
合計ジャッジ時間 3,311 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

tests = int(input())

def pow(a, p):
    result = 1
    while p > 0:
        if p & 1 == 1:
            result *= a
            result %= 998244353
        p >>= 1 
        a = a * a % 998244353
    return result

def inv(a):
    return pow(a, 998244351)

for _ in range(tests):
    n = int(input())
    a = map(int, input().split())
    current = 0

    for ai in a:
        current = (current + ai + current * ai) % 998244353

    print(current)
0