結果
| 問題 |
No.3070 Collecting Coins Speedrun 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-21 21:53:36 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 883 bytes |
| コンパイル時間 | 284 ms |
| コンパイル使用メモリ | 82,888 KB |
| 実行使用メモリ | 104,468 KB |
| 最終ジャッジ日時 | 2025-03-21 21:53:43 |
| 合計ジャッジ時間 | 6,428 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 WA * 6 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)rg
# (itertools.prrange(n)):
"""
n = 5
s = set()
for i in range(1<<n):
a,b = [],[]
for j in range(n):
if(i >> j) & 1 == 0:
a.append(j)
else:
b.append(j)
b.reverse()
a += b
s.add(tuple(a))
print(len(s))
exit()
"""
n = int(input())
a = list(map(int,input().split()))
#alist = []
#s = input()
#n,m = map(int,input().split())
#for i in range(n):
# alist.append(list(map(int,input().split())))
def f(r):
if r <= 1:
return 1
else:
return pow(2,r-1,mod)
x,y,z = 0,0,0
for i in a:
if i < 0:
x += 1
if i == 0:
y += 1
if i > 0:
z += 1
mod = 998244353
ans = f(x) * f(z)
if x > 0 and z > 0:
ans *= 2
if y == 1:
ans *= 3
print(ans % mod)