{"problem":{"name":"L. Cheating detection.","description":{"content":"In SPC cheating is allowed, but any way Kilani likes to check if the participants are cheating or not, (especially Omar and Wesam :P) In SPC you can only submit codes in one programming languages whi","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10241L"},"statements":[{"statement_type":"Markdown","content":"In SPC cheating is allowed, but any way Kilani likes to check if the participants are cheating or not, (especially Omar and Wesam :P)\n\nIn SPC you can only submit codes in one programming languages which is Abu elayayeeeb programming language,a language developed by Ayoub \n\nAyoub didn't finish developing it yet but he created 4 commands \n\n_define_ $x$\n\n$a = b + c$\n\n_read_ $x$\n\n_print_ $x$\n\nEvery command should be on one line. Kilani thinks that two students cheated if and only if you can rename the variables so that the first code becomes exactly the same as the second code.\n\nYou are given two codes, did they cheat?\n\nThe first line contains one integer $n$ $(1 <= n <= 1000)$, which is the number of lines of the first code.\n\nThe next $n$ lines will contain one of four commands.\n\n_define_ $x$\n\n$a$ = $b$ + $c$\n\n_read_ $x$\n\n_print_ $x$\n\nWhere $x$, $a$, $b$ and $c$ are a names of variables.\n\nThe first line contains one integer $m$ $(1 <= m <= 1000)$, which is the number of lines of the second code.\n\nThe next $m$ lines will contain one of four commands.\n\n_define_ $x$\n\n$a$ = $b$ + $c$\n\n_read_ $x$\n\n_print_ $x$\n\nwhere $x$, $a$, $b$ and $c$ are a names of variables.\n\nIt's guaranteed that before using any variable it will be defined, and the name of every variable will contain lowercase English letters of length at most 10, and no variable is defined twice.\n\nThe variables can't be one of the reserved word(define, print, read).\n\nif they cheated print _YES_ otherwise print _NO_.\n\n## Input\n\nThe first line contains one integer $n$ $(1 <= n <= 1000)$, which is the number of lines of the first code.The next $n$ lines will contain one of four commands._define_ $x$$a$ = $b$ + $c$_read_ $x$_print_ $x$Where $x$, $a$, $b$ and $c$ are a names of variables.The first line contains one integer $m$ $(1 <= m <= 1000)$, which is the number of lines of the second code.The next $m$ lines will contain one of four commands._define_ $x$$a$ = $b$ + $c$_read_ $x$_print_ $x$where $x$, $a$, $b$ and $c$ are a names of variables.It's guaranteed that before using any variable it will be defined, and the name of every variable will contain lowercase English letters of length at most 10, and no variable is defined twice.The variables can't be one of the reserved word(define, print, read).\n\n## Output\n\nif they cheated print _YES_ otherwise print _NO_.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ C_1 = (c_{1,1}, \\dots, c_{1,n}) $ and $ C_2 = (c_{2,1}, \\dots, c_{2,m}) $ be two sequences of commands, where each command is one of:  \n- $ \\texttt{define } x $  \n- $ a = b + c $  \n- $ \\texttt{read } x $  \n- $ \\texttt{print } x $  \nwith $ x, a, b, c $ being variable names (strings over lowercase English letters, length ≤ 10), and no variable is redefined.\n\n**Constraints**  \n1. $ 1 \\le n, m \\le 1000 $  \n2. All variable names are distinct within each code.  \n3. Every variable used is defined before use.  \n4. Reserved words $ \\texttt{define}, \\texttt{read}, \\texttt{print} $ do not appear as variable names.\n\n**Objective**  \nDetermine whether there exists a bijection $ f $ from the set of variable names in $ C_1 $ to the set of variable names in $ C_2 $ such that applying $ f $ to all variable names in $ C_1 $ results in a sequence identical to $ C_2 $.  \nIf such $ f $ exists, output **YES**; otherwise, output **NO**.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10241L","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}