{"problem":{"name":"E. Substring Reverse","description":{"content":"Two strings s and t of the same length are given. Determine whether it is possible to make t from s using exactly one reverse of some its substring. The first line contains the string s, and the seco","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10175E"},"statements":[{"statement_type":"Markdown","content":"Two strings s and t of the same length are given. Determine whether it is possible to make t from s using exactly one reverse of some its substring.\n\nThe first line contains the string s, and the second — the string t. Both strings have the same length from 1 to 200000 characters and consist of lowercase Latin letters.\n\nOutput «_YES_», if it is possible to reverse some substring of s to make s equal to t, and «_NO_», otherwise.\n\n## Input\n\nThe first line contains the string s, and the second — the string t. Both strings have the same length from 1 to 200000 characters and consist of lowercase Latin letters.\n\n## Output\n\nOutput «_YES_», if it is possible to reverse some substring of s to make s equal to t, and «_NO_», otherwise.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ s, t \\in \\Sigma^n $ be two strings of equal length $ n $, where $ \\Sigma $ is the set of lowercase Latin letters and $ 1 \\leq n \\leq 200000 $.\n\n**Constraints**  \n$ |s| = |t| = n $\n\n**Objective**  \nDetermine whether there exist indices $ i, j \\in \\{1, \\dots, n\\} $ with $ i \\leq j $ such that reversing the substring $ s[i:j] $ results in $ t $. That is,  \n$$\nt = s[1:i-1] + \\text{reverse}(s[i:j]) + s[j+1:n]\n$$  \nOutput \"YES\" if such $ i, j $ exist; otherwise, output \"NO\".","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10175E","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}