結果
問題 |
No.3070 Collecting Coins Speedrun 2
|
ユーザー |
|
提出日時 | 2025-04-02 10:50:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 63 ms / 2,000 ms |
コード長 | 360 bytes |
コンパイル時間 | 463 ms |
コンパイル使用メモリ | 82,504 KB |
実行使用メモリ | 82,784 KB |
最終ジャッジ日時 | 2025-04-02 10:50:43 |
合計ジャッジ時間 | 3,738 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
import bisect n=int(input()) C=list(map(int,input().split())) mod=998244353 c1=bisect.bisect_left(C,0) c2=n-bisect.bisect_right(C,0) ans=1 if c1>0: ans*=pow(2,c1-1,mod) if c2>0: ans *= pow(2, c2 - 1, mod) ans%=mod if c1>0 and c2>0: ans*=2 if n-c1-c2==1: if c1>0 and c2>0: ans*=3 elif c1>0 or c2>0: ans*=2 ans%=mod print(ans)