{"problem":{"name":"F. Forests in Danger","description":{"content":"The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10234F"},"statements":[{"statement_type":"Markdown","content":"The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the length of the sequence.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of integers, where $ a_i \\in \\mathbb{Z} $ for all $ i \\in \\{1, \\dots, n\\} $.  \n\nA *subsegment* is defined as a contiguous subsequence $ (a_i, a_{i+1}, \\dots, a_j) $ for $ 1 \\leq i \\leq j \\leq n $.  \nLet $ P(i,j) = \\prod_{k=i}^{j} a_k $ denote the product of the subsegment from index $ i $ to $ j $.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 2 \\cdot 10^5 $  \n2. $ -10^9 \\leq a_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nCompute the following three values:  \n- $ N_{\\text{neg}} = \\left| \\left\\{ (i,j) \\mid 1 \\leq i \\leq j \\leq n,\\ P(i,j) < 0 \\right\\} \\right| $  \n- $ N_{\\text{zero}} = \\left| \\left\\{ (i,j) \\mid 1 \\leq i \\leq j \\leq n,\\ P(i,j) = 0 \\right\\} \\right| $  \n- $ N_{\\text{pos}} = \\left| \\left\\{ (i,j) \\mid 1 \\leq i \\leq j \\leq n,\\ P(i,j) > 0 \\right\\} \\right| $  \n\nOutput: $ N_{\\text{neg}},\\ N_{\\text{zero}},\\ N_{\\text{pos}} $","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10234F","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}