{"problem":{"name":"115. Pseudocode Compiler","description":{"content":"In this question your goal is to make a program that will simulate running some pretty basic pseudocode. Here is the syntax that will be used: Defining a variable: -\"var variableName = value\" -value ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269115"},"statements":[{"statement_type":"Markdown","content":"In this question your goal is to make a program that will simulate running some pretty basic pseudocode. Here is the syntax that will be used:\n\nDefining a variable: -\"var variableName = value\" -value can be any integer -value can be a simple math equations ex: \"3 + 5\" -value can be a simple math equation that includes a variable \"testVar + 2\"\n\nManipulating a variable: -\"variableName = value\" -same rules applied to what the value can be as the one above -Ex: \"test1 = test1 + 2 - test2\"\n\nPrinting: -\"print (hello word )+exampleVariable+\" -text that is being printed will be surrounded in parentheses -variables being printed will be surrounded in addition signs\n\nThe first line will be the number of lines of code. The next X number of lines will be the code that you need to simulate.\n\nPrint whatever the program prints.\n\n## Input\n\nThe first line will be the number of lines of code. The next X number of lines will be the code that you need to simulate.\n\n## Output\n\nPrint whatever the program prints.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of code lines.  \nLet $ \\mathcal{V} $ be a finite map from variable names to integer values, initially empty.  \n\n**Syntax Rules**  \n1. **Variable Definition**:  \n   - Format: `var x = e`  \n   - $ e $ is an arithmetic expression over integers and existing variables in $ \\mathcal{V} $.  \n   - Evaluate $ e $ to integer $ v $, then set $ \\mathcal{V}[x] \\leftarrow v $.  \n\n2. **Variable Assignment**:  \n   - Format: `x = e`  \n   - Same evaluation rules as above; update $ \\mathcal{V}[x] \\leftarrow \\text{eval}(e) $.  \n\n3. **Print Statement**:  \n   - Format: `print (s_0) + x_1 + (s_1) + x_2 + \\dots + (s_k)`  \n   - $ s_i \\in \\mathbb{S} $ are string literals (without quotes), $ x_j \\in \\text{dom}(\\mathcal{V}) $ are variable names.  \n   - Output: Concatenation of $ s_0 $, $ \\mathcal{V}[x_1] $, $ s_1 $, $ \\mathcal{V}[x_2] $, ..., $ s_k $, with each $ \\mathcal{V}[x_j] $ converted to its decimal string representation.  \n\n**Constraints**  \n- All expressions $ e $ are well-formed arithmetic expressions using `+`, `-`, integers, and variables in $ \\mathcal{V} $.  \n- All variables in expressions are defined before use.  \n- All print statements follow the exact format with parentheses and `+` delimiters.  \n\n**Objective**  \nSimulate the $ n $ lines of code in order. For each print statement, output the resulting concatenated string.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269115","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}