結果
問題 |
No.3070 Collecting Coins Speedrun 2
|
ユーザー |
|
提出日時 | 2025-04-02 10:48:23 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 294 bytes |
コンパイル時間 | 402 ms |
コンパイル使用メモリ | 82,448 KB |
実行使用メモリ | 83,044 KB |
最終ジャッジ日時 | 2025-04-02 10:48:28 |
合計ジャッジ時間 | 4,453 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 WA * 6 |
ソースコード
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 ans*=pow(3,n-c1-c2,mod) ans%=mod print(ans)