Dãy giống nhau

View as PDF

Submit solution

Points: 100.00 (partial)
Time limit: 1.0s
Memory limit: 102M
Input: stdin
Output: stdout

Author:
Problem type

Cho 2 dãy số dài ~n~. Kiểm tra xem 2 dãy này có giống nhau không

Input
  • Dòng 1: số ~n~ ~(3 \leq n < 10^5)~
  • Dòng 2: chứa ~n~ số nguyên ~a_i~ mô tả dãy số ~a(1 \leq a_i \leq 10^9)~
  • Dòng 3: chứa ~n~ số nguyên ~b_i~ mô tả dãy số ~b(1 \leq b_i \leq 10^9)~
Output
  • In ra YES nếu 2 dãy giống nhau, NO nếu 2 dãy không giống nhau
Example

Input

5
2 1 3 5 4
1 2 3 4 5

Output

YES

Comments

Please read the guidelines before commenting.


There are no comments at the moment.