-
Notifications
You must be signed in to change notification settings - Fork 0
/
R_Permutation_with_arrays.cpp
74 lines (62 loc) · 1.22 KB
/
R_Permutation_with_arrays.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// GOOD LUCK
// | | | Ķ
// ( | Ķ
// | | |Ķ
// ) | Ķ
// | | • | Ķ
// DATE: 09-12-2022
// TIME: 22-55-00
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sq(a) (a) * (a)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < n; i++)
// #define forn(i,n) for (const int &n : numbers)
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define DEP(i, b, a) for (int i = b; i >= a; i--)
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(NULL);
int n;
cin >> n;
int a[n], b[n];
forn(i, n)
{
cin >> a[i];
}
forn(i, n)
{
cin >> b[i];
}
sort(a, a + n);
// forn(i, n)
// {
// cout << a[i];
// }
// cout << "\n";
sort(b, b + n);
// forn(i, n)
// {
// cout << b[i];
// }
// cout << "\n";
int ct = 0;
forn(i, n)
{
if (a[i] == b[i])
{
ct++;
}
}
if (ct == n)
cout << "yes";
else
cout << "no";
return 0;
}