結果
| 問題 |
No.1336 Union on Blackboard
|
| コンテスト | |
| ユーザー |
👑 terry_u16
|
| 提出日時 | 2021-01-15 21:57:08 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 448 bytes |
| コンパイル時間 | 437 ms |
| コンパイル使用メモリ | 82,092 KB |
| 実行使用メモリ | 62,528 KB |
| 最終ジャッジ日時 | 2024-11-26 14:28:58 |
| 合計ジャッジ時間 | 2,889 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 31 |
ソースコード
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)
terry_u16