{"problem":{"name":"F. 2 + 2 != 4","description":{"content":"One very experienced problem writer decided to prepare a problem for April Fools Day contest. The task was very simple - given an arithmetic expression, return the result of evaluating this expression","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF952F"},"statements":[{"statement_type":"Markdown","content":"One very experienced problem writer decided to prepare a problem for April Fools Day contest. The task was very simple - given an arithmetic expression, return the result of evaluating this expression. However, looks like there is a bug in the reference solution...\n\n## Input\n\nThe only line of input data contains the arithmetic expression. The expression will contain between 2 and 10 operands, separated with arithmetic signs plus and/or minus. Each operand will be an integer between 0 and 255, inclusive.\n\n## Output\n\nReproduce the output of the reference solution, including the bug.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"一位非常有经验的题目出题人决定为愚人节比赛准备一道题。任务非常简单——给定一个算术表达式，返回该表达式的计算结果。然而，参考程序似乎存在一个 bug...\n\n输入数据仅有一行，包含一个算术表达式。表达式将包含 2 到 10 个操作数，由加号和/或减号分隔。每个操作数均为 0 到 255（含）之间的整数。\n\n请复现参考程序的输出，包括其 bug。\n\n## Input\n\nThe only line of input data contains the arithmetic expression. The expression will contain between 2 and 10 operands, separated with arithmetic signs plus and/or minus. Each operand will be an integer between 0 and 255, inclusive.\n\n## Output\n\nReproduce the output of the reference solution, including the bug.\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ E $ be an arithmetic expression of the form:  \n$$\na_1 \\circ_1 a_2 \\circ_2 a_3 \\circ_3 \\cdots \\circ_{n-1} a_n\n$$  \nwhere:  \n- $ n \\in \\mathbb{Z} $, $ 2 \\leq n \\leq 10 $, is the number of operands,  \n- $ a_i \\in \\mathbb{Z} $, $ 0 \\leq a_i \\leq 255 $, for all $ i \\in \\{1, \\dots, n\\} $,  \n- $ \\circ_j \\in \\{+, -\\} $ for all $ j \\in \\{1, \\dots, n-1\\} $.\n\n**Constraints**  \n1. The expression is given as a single string with no parentheses, no whitespace, and operands and operators concatenated directly.  \n2. All operands are non-negative integers in $[0, 255]$.  \n3. Operators are only `+` and `-`.\n\n**Objective**  \nReproduce the output of a reference solution with the following bug:  \n> The expression is evaluated **left-to-right**, ignoring standard operator precedence, **but** the first operator is **always treated as addition**, regardless of its actual symbol.\n\nThat is, define the evaluation function $ f(E) $ as:  \n$$\nf(E) = a_1 \\oplus a_2 \\oplus a_3 \\oplus \\cdots \\oplus a_n\n$$  \nwhere:  \n- $ \\oplus $ denotes left-to-right binary operation,  \n- The operation between $ a_1 $ and $ a_2 $ is **always addition**, i.e., $ a_1 + a_2 $,  \n- For $ i \\geq 3 $, the operation between the accumulated result and $ a_i $ is determined by $ \\circ_{i-1} $:  \n  $$\n  \\text{result} = \n  \\begin{cases}\n  \\text{result} + a_i & \\text{if } \\circ_{i-1} = + \\\\\n  \\text{result} - a_i & \\text{if } \\circ_{i-1} = -\n  \\end{cases}\n  $$\n\n**Note**: The bug is that the **first operator $ \\circ_1 $ is ignored** and replaced with `+`, even if it is `-`.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF952F","tags":[],"sample_group":[["8-7+6-5+4-3+2-1-0","4"],["2+2","\\-46"],["112-37","375"]],"created_at":"2026-03-03 11:00:39"}}