050. The Array Checker-inator!

Codeforces
IDCF10269050
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Given two arrays of integers, check if they are equal... But, if the arrays can be made equal through the removal of duplicates or sorting, they are equal. The first line will represent the elements, n, in the first array. Then, you will be given n integers inputted on their own lines. After that, another integer will be inputted, which represents the elements, m, in the second array. Then m integers will follow, all being inputted on separate lines. Print "YES" (without the quotes) if you these arrays are equal (or if they are equal after removing duplicates and sorting them), or "NO" (without the quotes) if the arrays cannot be made equal. ## Input The first line will represent the elements, n, in the first array. Then, you will be given n integers inputted on their own lines. After that, another integer will be inputted, which represents the elements, m, in the second array. Then m integers will follow, all being inputted on separate lines. ## Output Print "YES" (without the quotes) if you these arrays are equal (or if they are equal after removing duplicates and sorting them), or "NO" (without the quotes) if the arrays cannot be made equal. [samples]
**Definitions** Let $ A = (a_1, a_2, \dots, a_n) $ be the first array of integers. Let $ B = (b_1, b_2, \dots, b_m) $ be the second array of integers. **Constraints** - $ n, m \in \mathbb{Z}^+ $ - $ a_i, b_j \in \mathbb{Z} $ for all valid indices **Objective** Define $ \text{UniqueSorted}(X) $ as the sorted list of unique elements of array $ X $. Output "YES" if $ \text{UniqueSorted}(A) = \text{UniqueSorted}(B) $, otherwise output "NO".
API Response (JSON)
{
  "problem": {
    "name": "050. The Array Checker-inator!",
    "description": {
      "content": "Given two arrays of integers, check if they are equal... But, if the arrays can be made equal through the removal of duplicates or sorting, they are equal.  The first line will represent the elements",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269050"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given two arrays of integers, check if they are equal... But, if the arrays can be made equal through the removal of duplicates or sorting, they are equal. \n\nThe first line will represent the elements...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be the first array of integers.  \nLet $ B = (b_1, b_2, \\dots, b_m) $ be the second array of integers.  \n\n**Constraints**  \n- $ n, m \\in \\mathbb{Z}^...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments