結果
問題 |
No.3070 Collecting Coins Speedrun 2
|
ユーザー |
![]() |
提出日時 | 2025-03-22 03:33:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 332 bytes |
コンパイル時間 | 491 ms |
コンパイル使用メモリ | 82,044 KB |
実行使用メモリ | 84,088 KB |
最終ジャッジ日時 | 2025-03-22 03:33:48 |
合計ジャッジ時間 | 3,452 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 WA * 6 |
ソースコード
MOD = 998244353 N = int(input()) A = list(map(int, input().split())) neg = pos = 0 for a in A: if a < 0: neg += 1 elif a > 0: pos += 1 res = 1 if neg > 1: res *= pow(2, neg-1, MOD) if pos > 1: res *= pow(2, pos-1, MOD) if neg > 0 and pos > 0: res *= 2 if 0 in A: res *= 3 print(res % MOD)