結果
| 問題 | No.1336 Union on Blackboard |
| コンテスト | |
| ユーザー |
👑 terry_u16
|
| 提出日時 | 2021-01-15 21:57:08 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 1,360 ms |
| コンパイル使用メモリ | 84,864 KB |
| 実行使用メモリ | 60,544 KB |
| 最終ジャッジ日時 | 2026-05-21 01:16:25 |
| 合計ジャッジ時間 | 3,798 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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