結果
問題 |
No.3070 Collecting Coins Speedrun 2
|
ユーザー |
![]() |
提出日時 | 2025-03-22 02:11:32 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 70 ms / 2,000 ms |
コード長 | 330 bytes |
コンパイル時間 | 385 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 83,968 KB |
最終ジャッジ日時 | 2025-03-22 02:11:36 |
合計ジャッジ時間 | 3,655 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
n=int(input()) c=list(map(int,input().split())) M=998244353 g=[0]*3 for x in c: if x>0: g[0]+=1 if x==0: g[1]+=1 if x<0: g[2]+=1 a=1 if g[0]>0: a*=pow(2,g[0]-1,M) if g[2]>0: a*=pow(2,g[2]-1,M) if g[0]>0 and g[2]>0: a*=2 if g[1]: if g[0]>0 and g[2]>0: a*=3 elif g[0]>0 or g[2]>0: a*=2 print(a%M)