about summary refs log tree commit diff
path: root/others/volume1/032.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/032.pas')
-rw-r--r--others/volume1/032.pas24
1 files changed, 24 insertions, 0 deletions
diff --git a/others/volume1/032.pas b/others/volume1/032.pas
new file mode 100644
index 0000000..7813997
--- /dev/null
+++ b/others/volume1/032.pas
@@ -0,0 +1,24 @@
+uses sortnfind;
+
+var
+  n, i: int16;
+  a, b: array of int64;
+
+begin
+  readln(n);
+  setlength(a, n);
+  for i := 0 to n - 1 do
+    read(a[i]);
+  qsort(a);
+  setlength(b, n);
+  for i := 0 to n - 1 do
+    read(b[i]);
+  qsort(b);
+  for i := 0 to n - 1 do
+    if a[i] <> b[i] then
+      begin
+        writeln('NO');
+        exit
+      end;
+  writeln('YES')
+end.